fix: 解决 vue 组件未兼容繁体的问题 (#7044)

Refs #7033
This commit is contained in:
ssongliu 2024-11-14 14:18:02 +08:00 committed by GitHub
parent 6e690cc6f2
commit dc30a3d1c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -8,6 +8,7 @@
import { reactive, computed, ref, nextTick, provide } from 'vue'; import { reactive, computed, ref, nextTick, provide } from 'vue';
import { GlobalStore } from '@/store'; import { GlobalStore } from '@/store';
import zhCn from 'element-plus/es/locale/lang/zh-cn'; import zhCn from 'element-plus/es/locale/lang/zh-cn';
import zhTw from 'element-plus/es/locale/lang/zh-tw';
import en from 'element-plus/es/locale/lang/en'; import en from 'element-plus/es/locale/lang/en';
import { useTheme } from '@/hooks/use-theme'; import { useTheme } from '@/hooks/use-theme';
useTheme(); useTheme();
@ -19,6 +20,7 @@ const config = reactive({
const i18nLocale = computed(() => { const i18nLocale = computed(() => {
if (globalStore.language === 'zh') return zhCn; if (globalStore.language === 'zh') return zhCn;
if (globalStore.language === 'tw') return zhTw;
if (globalStore.language === 'en') return en; if (globalStore.language === 'en') return en;
return zhCn; return zhCn;
}); });

View File

@ -1,4 +1,4 @@
import fit2cloudTwLocale from 'fit2cloud-ui-plus/src/locale/lang/zh-cn'; import fit2cloudTwLocale from 'fit2cloud-ui-plus/src/locale/lang/zh-tw';
let xpackTwLocale = {}; let xpackTwLocale = {};
const xpackModules = import.meta.glob('../../xpack/lang/tw.ts', { eager: true }); const xpackModules = import.meta.glob('../../xpack/lang/tw.ts', { eager: true });
if (xpackModules['../../xpack/lang/tw.ts']) { if (xpackModules['../../xpack/lang/tw.ts']) {