diff --git a/lib/util/i18n.js b/lib/util/i18n.js index 9dfe53126..deb7c88e6 100644 --- a/lib/util/i18n.js +++ b/lib/util/i18n.js @@ -117,6 +117,7 @@ async function loadOtpUiLocaleData(matchedLocale) { */ export async function loadLocaleData(matchedLocale, customMessages) { let messages + let otpUiLocale = matchedLocale switch (matchedLocale) { case 'es': // Spanish translation is not specific to a region messages = await import('../../i18n/es.yml') @@ -130,15 +131,18 @@ export async function loadLocaleData(matchedLocale, customMessages) { case 'vi': // Vietnamese translation is not specific to a region messages = await import('../../i18n/vi.yml') break - case 'zh': // Chinese translation is not specific to a region + case 'zh': // Chinese (Simplified) translation is not specific to a region messages = await import('../../i18n/zh.yml') + // The OTP-UI files for Chinese (Simplified) are (correclty) named `zh_Hans`. + // TODO: Rename this repo's zh files to zh_Hans + otpUiLocale = 'zh_Hans' break default: messages = await import('../../i18n/en-US.yml') break } - const otpUiMessages = await loadOtpUiLocaleData(matchedLocale) + const otpUiMessages = await loadOtpUiLocaleData(otpUiLocale) // Merge custom strings into the standard language strings. const mergedMessages = {