Skip to content

Commit 39f9676

Browse files
committed
refactor: ♻️ (i18n/lang)将语言包从 TypeScript 文件迁移到 JSON 文件
- 将 en.ts 和 zh-cn.ts 文件分别重命名为 en.json 和 zh-cn.json - 更新导入路径以使用新的 JSON 文件 - 删除旧的 TypeScript 语言包文件 #ICWF9O
1 parent 328e093 commit 39f9676

File tree

5 files changed

+187
-195
lines changed

5 files changed

+187
-195
lines changed

src/lang/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import type { App } from "vue";
22
import { createI18n } from "vue-i18n";
33
import { useAppStoreHook } from "@/store/modules/app-store";
44
// 本地语言包
5-
import enLocale from "./package/en";
6-
import zhCnLocale from "./package/zh-cn";
5+
import enLocale from "./package/en.json";
6+
import zhCnLocale from "./package/zh-cn.json";
77

88
const appStore = useAppStoreHook();
99

src/lang/package/en.json

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
{
2+
"route": {
3+
"dashboard": "Dashboard",
4+
"document": "Document"
5+
},
6+
"login": {
7+
"themeToggle": "Theme Switch",
8+
"languageToggle": "Language Switch",
9+
"dark": "Dark",
10+
"light": "Light",
11+
"username": "Username",
12+
"password": "Password",
13+
"login": "Login",
14+
"captchaCode": "Verify Code",
15+
"capsLock": "Caps Lock is On",
16+
"rememberMe": "Remember Me",
17+
"forgetPassword": "Forget Password?",
18+
"message": {
19+
"username": {
20+
"required": "Please enter Username"
21+
},
22+
"password": {
23+
"required": "Please enter Password",
24+
"min": "The password can not be less than 6 digits",
25+
"confirm": "Please confirm the password again",
26+
"inconformity": "The two password entries are inconsistent"
27+
},
28+
"captchaCode": {
29+
"required": "Please enter Verify Code"
30+
}
31+
},
32+
"otherLoginMethods": "Other",
33+
"resetPassword": "Reset password",
34+
"thinkOfPasswd": "Remember your password?",
35+
"register": "Register account",
36+
"agree": "I have read and agree to the",
37+
"userAgreement": "User Agreement",
38+
"haveAccount": "Already have an account?",
39+
"noAccount": "Don't have an account?",
40+
"quickFill": "Quick fill",
41+
"reg": "Register"
42+
},
43+
"navbar": {
44+
"dashboard": "Dashboard",
45+
"logout": "Logout",
46+
"document": "Document",
47+
"gitee": "Gitee",
48+
"profile": "User Profile"
49+
},
50+
"sizeSelect": {
51+
"tooltip": "Layout Size",
52+
"default": "Default",
53+
"large": "Large",
54+
"small": "Small",
55+
"message": {
56+
"success": "Switch Layout Size Successful!"
57+
}
58+
},
59+
"langSelect": {
60+
"message": {
61+
"success": "Switch Language Successful!"
62+
}
63+
},
64+
"settings": {
65+
"project": "Project Settings",
66+
"theme": "Theme",
67+
"interface": "Interface",
68+
"navigation": "Navigation",
69+
"themeColor": "Theme Color",
70+
"showTagsView": "Show Tags View",
71+
"showAppLogo": "Show App Logo",
72+
"sidebarColorScheme": "Sidebar Color Scheme",
73+
"showWatermark": "Show Watermark",
74+
"classicBlue": "Classic Blue",
75+
"minimalWhite": "Minimal White",
76+
"copyConfig": "Copy Config",
77+
"resetConfig": "Reset Default",
78+
"copySuccess": "Configuration copied to clipboard",
79+
"resetSuccess": "Reset to default configuration",
80+
"copyDescription": "Copy config will generate current settings code, reset will restore all settings to default",
81+
"confirmReset": "Are you sure to reset all settings to default? This operation cannot be undone.",
82+
"applyToFile": "Apply to File",
83+
"onlyCopy": "Only Copy",
84+
"leftLayout": "Left Mode",
85+
"topLayout": "Top Mode",
86+
"mixLayout": "Mix Mode",
87+
"configManagement": "Config Management",
88+
"copyConfigDescription": "Generate current settings code and copy to clipboard, then overwrite src/settings.ts file",
89+
"resetConfigDescription": "Restore all settings to system default values"
90+
}
91+
}

src/lang/package/en.ts

Lines changed: 0 additions & 96 deletions
This file was deleted.

src/lang/package/zh-cn.json

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
{
2+
"route": {
3+
"dashboard": "首页",
4+
"document": "项目文档"
5+
},
6+
"login": {
7+
"themeToggle": "主题切换",
8+
"languageToggle": "语言切换",
9+
"dark": "暗黑",
10+
"light": "明亮",
11+
"username": "用户名",
12+
"password": "密码",
13+
"login": "登 录",
14+
"captchaCode": "验证码",
15+
"capsLock": "大写锁定已打开",
16+
"rememberMe": "记住我",
17+
"forgetPassword": "忘记密码?",
18+
"message": {
19+
"username": {
20+
"required": "请输入用户名"
21+
},
22+
"password": {
23+
"required": "请输入密码",
24+
"min": "密码不能少于6位",
25+
"confirm": "请再次确认密码",
26+
"inconformity": "两次密码输入不一致"
27+
},
28+
"captchaCode": {
29+
"required": "请输入验证码"
30+
}
31+
},
32+
"otherLoginMethods": "其他",
33+
"resetPassword": "重置密码",
34+
"thinkOfPasswd": "想起密码?",
35+
"register": "注册账号",
36+
"agree": "我已同意并阅读",
37+
"userAgreement": "用户协议",
38+
"haveAccount": "已有账号?",
39+
"noAccount": "您没有账号?",
40+
"quickFill": "快速填写",
41+
"reg": "注 册"
42+
},
43+
"navbar": {
44+
"dashboard": "首页",
45+
"logout": "退出登录",
46+
"document": "项目文档",
47+
"gitee": "项目地址",
48+
"profile": "个人中心"
49+
},
50+
"sizeSelect": {
51+
"tooltip": "布局大小",
52+
"default": "默认",
53+
"large": "大型",
54+
"small": "小型",
55+
"message": {
56+
"success": "切换布局大小成功!"
57+
}
58+
},
59+
"langSelect": {
60+
"message": {
61+
"success": "切换语言成功!"
62+
}
63+
},
64+
"settings": {
65+
"project": "项目配置",
66+
"theme": "主题设置",
67+
"interface": "界面设置",
68+
"navigation": "导航设置",
69+
"themeColor": "主题颜色",
70+
"themeColorTip": "主题颜色",
71+
"darkMode": "暗黑模式",
72+
"layoutSetting": "布局设置",
73+
"sidebarColorScheme": "侧边栏配色",
74+
"showTagsView": "显示页签",
75+
"showAppLogo": "显示Logo",
76+
"showWatermark": "显示水印",
77+
"classicBlue": "经典蓝",
78+
"minimalWhite": "极简白",
79+
"copyConfig": "复制配置",
80+
"resetConfig": "重置默认",
81+
"copySuccess": "配置已复制到剪贴板",
82+
"resetSuccess": "已重置为默认配置",
83+
"copyDescription": "复制配置将生成当前设置的代码,重置将恢复所有设置为默认值",
84+
"confirmReset": "确定要重置所有设置为默认值吗?此操作不可恢复。",
85+
"applyToFile": "应用到文件",
86+
"onlyCopy": "仅复制",
87+
"leftLayout": "左侧模式",
88+
"topLayout": "顶部模式",
89+
"mixLayout": "混合模式",
90+
"configManagement": "配置管理",
91+
"copyConfigDescription": "生成当前设置的代码并复制到剪贴板,然后覆盖 src/settings.ts 文件",
92+
"resetConfigDescription": "恢复所有设置为系统默认值"
93+
}
94+
}

src/lang/package/zh-cn.ts

Lines changed: 0 additions & 97 deletions
This file was deleted.

0 commit comments

Comments
 (0)