2
0

初始化项目

This commit is contained in:
caiyuchao
2024-11-14 11:06:38 +08:00
parent 988b9e6799
commit 4ffac789e1
320 changed files with 34244 additions and 0 deletions

26
src/locales/index.ts Normal file
View File

@@ -0,0 +1,26 @@
import type { App } from 'vue';
import { createI18n } from 'vue-i18n';
import { localStg } from '@/utils/storage';
import messages from './locale';
const i18n = createI18n({
locale: localStg.get('lang') || 'zh-CN',
fallbackLocale: 'en',
messages,
legacy: false
});
/**
* Setup plugin i18n
*
* @param app
*/
export function setupI18n(app: App) {
app.use(i18n);
}
export const $t = i18n.global.t as App.I18n.$T;
export function setLocale(locale: App.I18n.LangType) {
i18n.global.locale.value = locale;
}