Fix translation tests part 2
This commit is contained in:
parent
cbf967a86d
commit
51131ef7a5
1 changed files with 4 additions and 2 deletions
|
@ -130,7 +130,9 @@ export function setLanguage(preferredLangs) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!langToUse) {
|
if (!langToUse) {
|
||||||
throw new Error("Unable to find an appropriate language");
|
// Fallback to en_EN if none is found
|
||||||
|
langToUse = 'en_EN'
|
||||||
|
console.error("Unable to find an appropriate language");
|
||||||
}
|
}
|
||||||
|
|
||||||
return getLanguage(i18nFolder + availLangs[langToUse].fileName);
|
return getLanguage(i18nFolder + availLangs[langToUse].fileName);
|
||||||
|
@ -142,7 +144,7 @@ export function setLanguage(preferredLangs) {
|
||||||
|
|
||||||
// Set 'en' as fallback language:
|
// Set 'en' as fallback language:
|
||||||
if (langToUse != "en_EN") {
|
if (langToUse != "en_EN") {
|
||||||
return getLanguage(i18nFolder + availLangs['en_EN'].fileName);
|
return getLanguage(i18nFolder + availLangs[langToUse].fileName);
|
||||||
}
|
}
|
||||||
}).then((langData) => {
|
}).then((langData) => {
|
||||||
if (langData) counterpart.registerTranslations('en_EN', langData);
|
if (langData) counterpart.registerTranslations('en_EN', langData);
|
||||||
|
|
Loading…
Reference in a new issue