Merge branch 'develop' of https://gitee.com/youlaiorg/vue3-element-admin into develop
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { App } from "vue";
|
||||
import { createI18n } from "vue-i18n";
|
||||
import { useAppStoreHook } from "@/store/modules/app-store";
|
||||
import { useAppStoreHook } from "@/store/modules/app";
|
||||
// 本地语言包
|
||||
import enLocale from "./package/en.json";
|
||||
import zhCnLocale from "./package/zh-cn.json";
|
||||
|
||||
13
src/lang/utils.ts
Normal file
13
src/lang/utils.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* 国际化工具函数
|
||||
*/
|
||||
import i18n from "./index";
|
||||
|
||||
/**
|
||||
* 翻译路由标题
|
||||
* 用于面包屑、侧边栏、标签页等场景
|
||||
*/
|
||||
export function translateRouteTitle(title: string): string {
|
||||
const key = `route.${title}`;
|
||||
return i18n.global.te(key) ? i18n.global.t(key) : title;
|
||||
}
|
||||
Reference in New Issue
Block a user