Skip to content

Commit 1cd1540

Browse files
author
萌狼蓝天
committed
2 parents ec84ad8 + bb51238 commit 1cd1540

File tree

9 files changed

+259
-306
lines changed

9 files changed

+259
-306
lines changed

.vscode/settings.json

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,8 @@
6363
"**/dist/**": true,
6464
"**/yarn.lock": true
6565
},
66-
"i18n-ally.keystyle": "nested",
67-
"i18n-ally.sortKeys": true,
68-
"i18n-ally.namespace": false,
69-
"i18n-ally.pathMatcher": "{namespaces}/{locale}.{ext}",
70-
"i18n-ally.enabledParsers": ["ts"],
71-
"i18n-ally.sourceLanguage": "en",
72-
"i18n-ally.displayLanguage": "zh-CN",
73-
"i18n-ally.enabledFrameworks": [
74-
"vue",
75-
"react"
76-
],
7766
"i18n-ally.localesPaths": [
78-
"src/lang"
67+
"src/lang/package"
7968
],
8069
"scss.lint.unknownAtRules": "ignore"
8170
}

eslint.config.ts

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
// https://eslint.org/docs/latest/use/configure/configuration-files-new
22

3+
// 基础ESLint配置
34
import eslint from "@eslint/js";
4-
import pluginVue from "eslint-plugin-vue";
5+
import globals from "globals";
6+
// TypeScript支持
57
import * as typescriptEslint from "typescript-eslint";
8+
// Vue支持
9+
import pluginVue from "eslint-plugin-vue";
610
import vueParser from "vue-eslint-parser";
7-
import globals from "globals";
11+
// 代码风格与格式化
812
import configPrettier from "eslint-config-prettier";
13+
import prettierPlugin from "eslint-plugin-prettier";
914

1015
// 解析自动导入配置
1116
import fs from "node:fs";
@@ -132,6 +137,7 @@ export default [
132137
sourceType: "module",
133138
parser: typescriptEslint.parser,
134139
extraFileExtensions: [".vue"],
140+
tsconfigRootDir: __dirname,
135141
},
136142
},
137143
rules: {
@@ -174,8 +180,10 @@ export default [
174180
languageOptions: {
175181
parser: typescriptEslint.parser,
176182
parserOptions: {
177-
project: true,
178-
tsconfigRootDir: import.meta.dirname,
183+
ecmaVersion: "latest",
184+
sourceType: "module",
185+
project: "./tsconfig.json",
186+
tsconfigRootDir: __dirname,
179187
},
180188
},
181189
rules: {
@@ -212,5 +220,15 @@ export default [
212220
},
213221

214222
// Prettier 集成(必须放在最后)
215-
configPrettier,
223+
{
224+
plugins: {
225+
prettier: prettierPlugin, // 将 Prettier 的输出作为 ESLint 的问题来报告
226+
},
227+
rules: {
228+
...configPrettier.rules,
229+
"prettier/prettier": ["error", {}, { usePrettierrc: true }],
230+
"arrow-body-style": "off",
231+
"prefer-arrow-callback": "off",
232+
},
233+
},
216234
];

src/lang/index.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,14 @@ 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

1010
const messages = {
11-
"zh-cn": {
12-
...zhCnLocale,
13-
},
14-
en: {
15-
...enLocale,
16-
},
11+
"zh-cn": zhCnLocale,
12+
en: enLocale,
1713
};
1814

1915
const i18n = createI18n({

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+
}

0 commit comments

Comments
 (0)