mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-10-07 02:01:37 +00:00
发布v2.0.0分支
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import type { App } from "vue";
|
||||
import { createI18n } from "vue-i18n";
|
||||
import { useAppStoreHook } from "@/store/modules/app.store";
|
||||
// 本地语言包
|
||||
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,
|
||||
globalInjection: true,
|
||||
});
|
||||
|
||||
// 全局注册 i18n
|
||||
export function setupI18n(app: App<Element>) {
|
||||
app.use(i18n);
|
||||
}
|
||||
|
||||
export default i18n;
|
||||
Reference in New Issue
Block a user