first commiit
This commit is contained in:
31
src/lang/index.ts
Normal file
31
src/lang/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { App } from "vue";
|
||||
import { createI18n } from "vue-i18n";
|
||||
import { useAppStoreHook } from "@/store/modules/app";
|
||||
// 本地语言包
|
||||
import enLocale from "./package/en";
|
||||
import zhCnLocale from "./package/zh-cn";
|
||||
|
||||
const appStore = useAppStoreHook();
|
||||
|
||||
const messages = {
|
||||
"zh-cn": {
|
||||
...zhCnLocale,
|
||||
},
|
||||
en: {
|
||||
...enLocale,
|
||||
},
|
||||
};
|
||||
|
||||
const i18n = createI18n({
|
||||
legacy: false,
|
||||
locale: appStore.language,
|
||||
messages: messages,
|
||||
globalInjection: true,
|
||||
});
|
||||
|
||||
// 全局注册 i18n
|
||||
export function setupI18n(app: App<Element>) {
|
||||
app.use(i18n);
|
||||
}
|
||||
|
||||
export default i18n;
|
||||
62
src/lang/package/en.ts
Normal file
62
src/lang/package/en.ts
Normal file
@@ -0,0 +1,62 @@
|
||||
export default {
|
||||
// 菜单国际化
|
||||
route: {
|
||||
dashboard: "Dashboard",
|
||||
document: "Document",
|
||||
},
|
||||
// 登录页面国际化
|
||||
login: {
|
||||
username: "Username",
|
||||
password: "Password",
|
||||
login: "Login",
|
||||
captchaCode: "Verify Code",
|
||||
capsLock: "Caps Lock is On",
|
||||
rememberMe: "Remember Me",
|
||||
forgetPassword: "Forget Password",
|
||||
message: {
|
||||
username: {
|
||||
required: "Please enter Username",
|
||||
},
|
||||
password: {
|
||||
required: "Please enter Password",
|
||||
min: "The password can not be less than 6 digits",
|
||||
},
|
||||
captchaCode: {
|
||||
required: "Please enter Verify Code",
|
||||
},
|
||||
},
|
||||
otherLoginMethods: "Other login methods",
|
||||
},
|
||||
// 导航栏国际化
|
||||
navbar: {
|
||||
dashboard: "Dashboard",
|
||||
logout: "Logout",
|
||||
document: "Document",
|
||||
gitee: "Gitee",
|
||||
profile: "User Profile",
|
||||
},
|
||||
sizeSelect: {
|
||||
tooltip: "Layout Size",
|
||||
default: "Default",
|
||||
large: "Large",
|
||||
small: "Small",
|
||||
message: {
|
||||
success: "Switch Layout Size Successful!",
|
||||
},
|
||||
},
|
||||
langSelect: {
|
||||
message: {
|
||||
success: "Switch Language Successful!",
|
||||
},
|
||||
},
|
||||
settings: {
|
||||
project: "Project Settings",
|
||||
theme: "Theme",
|
||||
interface: "Interface",
|
||||
navigation: "Navigation",
|
||||
themeColor: "Theme Color",
|
||||
tagsView: "Tags View",
|
||||
sidebarLogo: "Sidebar Logo",
|
||||
watermark: "Watermark",
|
||||
},
|
||||
};
|
||||
62
src/lang/package/zh-cn.ts
Normal file
62
src/lang/package/zh-cn.ts
Normal file
@@ -0,0 +1,62 @@
|
||||
export default {
|
||||
// 菜单国际化
|
||||
route: {
|
||||
dashboard: "首页",
|
||||
document: "项目文档",
|
||||
},
|
||||
// 登录页面国际化
|
||||
login: {
|
||||
username: "用户名",
|
||||
password: "密码",
|
||||
login: "登 录",
|
||||
captchaCode: "验证码",
|
||||
capsLock: "大写锁定已打开",
|
||||
rememberMe: "记住我",
|
||||
forgetPassword: "忘记密码",
|
||||
message: {
|
||||
username: {
|
||||
required: "请输入用户名",
|
||||
},
|
||||
password: {
|
||||
required: "请输入密码",
|
||||
min: "密码不能少于6位",
|
||||
},
|
||||
captchaCode: {
|
||||
required: "请输入验证码",
|
||||
},
|
||||
},
|
||||
otherLoginMethods: "其他登录方式",
|
||||
},
|
||||
// 导航栏国际化
|
||||
navbar: {
|
||||
dashboard: "首页",
|
||||
logout: "注销登出",
|
||||
document: "项目文档",
|
||||
gitee: "项目地址",
|
||||
profile: "个人中心",
|
||||
},
|
||||
sizeSelect: {
|
||||
tooltip: "布局大小",
|
||||
default: "默认",
|
||||
large: "大型",
|
||||
small: "小型",
|
||||
message: {
|
||||
success: "切换布局大小成功!",
|
||||
},
|
||||
},
|
||||
langSelect: {
|
||||
message: {
|
||||
success: "切换语言成功!",
|
||||
},
|
||||
},
|
||||
settings: {
|
||||
project: "项目配置",
|
||||
theme: "主题设置",
|
||||
interface: "界面设置",
|
||||
navigation: "导航设置",
|
||||
themeColor: "主题颜色",
|
||||
tagsView: "开启 Tags-View",
|
||||
sidebarLogo: "侧边栏 Logo",
|
||||
watermark: "开启水印",
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user