From bb4fd69f3a86b0f91dd1115a17c22c3a731cb420 Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Wed, 3 Apr 2024 17:40:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E6=B2=A1=E6=9C=89=20x?= =?UTF-8?q?pack=20=E6=89=93=E5=8C=85=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20(#4400)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/lang/modules/en.ts | 8 ++++---- frontend/src/lang/modules/tw.ts | 9 +++++---- frontend/src/lang/modules/zh.ts | 8 ++++---- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index e89b664db..f7aefcc56 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -1,9 +1,9 @@ import fit2cloudEnLocale from 'fit2cloud-ui-plus/src/locale/lang/en'; let xpackEnLocale = {}; -try { - const commercialTranslationModule = await import('@/xpack/lang/en'); - xpackEnLocale = commercialTranslationModule.default || {}; -} catch (error) {} +const xpackModules = import.meta.globEager('../../xpack/lang/en.ts'); +if (xpackModules['../../xpack/lang/en.ts']) { + xpackEnLocale = xpackModules['../../xpack/lang/en.ts'].default || {}; +} const message = { commons: { diff --git a/frontend/src/lang/modules/tw.ts b/frontend/src/lang/modules/tw.ts index ea3ddc81d..47a2dc8e7 100644 --- a/frontend/src/lang/modules/tw.ts +++ b/frontend/src/lang/modules/tw.ts @@ -1,9 +1,10 @@ import fit2cloudTwLocale from 'fit2cloud-ui-plus/src/locale/lang/zh-cn'; let xpackTwLocale = {}; -try { - const commercialTranslationModule = await import('@/xpack/lang/tw'); - xpackTwLocale = commercialTranslationModule.default || {}; -} catch (error) {} +const xpackModules = import.meta.globEager('../../xpack/lang/tw.ts'); +if (xpackModules['../../xpack/lang/tw.ts']) { + xpackTwLocale = xpackModules['../../xpack/lang/tw.ts'].default || {}; +} + const message = { commons: { true: '是', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index fdeede12e..5ed308f45 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -1,9 +1,9 @@ import fit2cloudZhLocale from 'fit2cloud-ui-plus/src/locale/lang/zh-cn'; let xpackZhLocale = {}; -try { - const commercialTranslationModule = await import('@/xpack/lang/zh'); - xpackZhLocale = commercialTranslationModule.default || {}; -} catch (error) {} +const xpackModules = import.meta.globEager('../../xpack/lang/zh.ts'); +if (xpackModules['../../xpack/lang/zh.ts']) { + xpackZhLocale = xpackModules['../../xpack/lang/zh.ts'].default || {}; +} const message = { commons: {