From 5802359269de977dd3846fd232b332e34ed894df Mon Sep 17 00:00:00 2001 From: gene9831 Date: Mon, 31 Mar 2025 17:36:49 +0800 Subject: [PATCH] fix: i18n create empty entries error --- packages/plugins/i18n/src/composable/useTranslate.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugins/i18n/src/composable/useTranslate.ts b/packages/plugins/i18n/src/composable/useTranslate.ts index 24e300c9ad..377794f40c 100644 --- a/packages/plugins/i18n/src/composable/useTranslate.ts +++ b/packages/plugins/i18n/src/composable/useTranslate.ts @@ -62,7 +62,7 @@ const removeI18n = (key = []) => { const ensureI18n = (obj, send) => { const { locales } = i18nResource - const contents = Object.fromEntries(locales.map(({ lang }) => [lang, obj[lang]])) + const contents = Object.fromEntries(locales.map(({ lang }) => [lang, obj[lang] || ''])) const langs = getLangs() const key = obj.key || utils.guid()