Fix language file conflicts (#451)

This commit is contained in:
Darko Gjorgjijoski
2025-08-30 01:36:13 +02:00
committed by GitHub
parent 02701db815
commit 2f8c98003d
2 changed files with 7 additions and 1 deletions

View File

@@ -19,7 +19,12 @@ export async function loadLanguage(locale) {
try {
// Dynamic import of language file
const languageModule = await import(`../../../lang/${locale === 'pt_BR' ? 'pt-br' : locale}.json`)
const fileMap = {
'zh_CN': 'zh-cn',
'pt_BR': 'pt-br',
}
const fileName = fileMap[locale] || locale;
const languageModule = await import(`../../../lang/${fileName}.json`)
const messages = languageModule.default || languageModule
// Cache the loaded language