load english as fallback
This commit is contained in:
parent
3a5a43d08e
commit
5ca8af0954
@ -120,6 +120,8 @@ async function setActiveLanguage(lang) {
|
||||
document.querySelector("[data-lang=" + lang + "]").classList.add("active");
|
||||
const response = await fetch(`/webui/translations/${lang}.json`);
|
||||
const translations = await response.json();
|
||||
const fallbackResponse = await fetch(`/webui/translations/en.json`);
|
||||
const fallbackTranslations = await fallbackResponse.json();
|
||||
|
||||
i18next.init(
|
||||
{
|
||||
@ -128,6 +130,9 @@ async function setActiveLanguage(lang) {
|
||||
resources: {
|
||||
[lang]: {
|
||||
translation: translations
|
||||
},
|
||||
en: {
|
||||
translation: fallbackTranslations
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user