mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
feat(projects): 增加i18n支持翻译菜单,tab,title
This commit is contained in:
@ -1,12 +1,14 @@
|
||||
import type { App } from 'vue';
|
||||
import { createI18n } from 'vue-i18n';
|
||||
import { localStg } from '@/utils';
|
||||
import messages from './lang';
|
||||
import type { LocaleKey } from './lang';
|
||||
|
||||
const i18n = createI18n({
|
||||
locale: 'zh-CN',
|
||||
locale: localStg.get('lang') || 'zh-CN',
|
||||
fallbackLocale: 'en',
|
||||
messages
|
||||
messages,
|
||||
legacy: false
|
||||
});
|
||||
|
||||
export function setupI18n(app: App) {
|
||||
@ -18,5 +20,5 @@ export function t(key: string) {
|
||||
}
|
||||
|
||||
export function setLocale(locale: LocaleKey) {
|
||||
i18n.global.locale = locale;
|
||||
i18n.global.locale.value = locale;
|
||||
}
|
||||
|
Reference in New Issue
Block a user