From f17e5e91be6346a63689b86cebbf6efc1238db87 Mon Sep 17 00:00:00 2001 From: fly_mc Date: Tue, 19 Nov 2024 02:31:15 +0800 Subject: [PATCH] fix locales --- locales/index.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/locales/index.js b/locales/index.js index 7783a00821c0..ecb9e97fe0e6 100644 --- a/locales/index.js +++ b/locales/index.js @@ -86,12 +86,11 @@ export function build() { case 'zh-TW': return merge(locales['en-US'], v); default: - return merge( - locales['en-US'], - locales['ja-JP'], - locales[`${lang}-${primaries[lang]}`] ?? {}, - v - ); + const base = Object.keys(v).some(key => + !locales['en-US'][key] && locales['ja-JP'][key] + ) ? merge(locales['en-US'], locales['ja-JP']) : locales['en-US']; + + return merge(base, v); } })(), a), {}); }