load english as fallback
All checks were successful
Build / build (20) (pull_request) Successful in 35s
Build / build (22) (pull_request) Successful in 52s
Build / build (18) (pull_request) Successful in 1m4s

This commit is contained in:
AMelonInsideLemon 2025-02-05 07:30:24 +01:00
parent 3a5a43d08e
commit 5ca8af0954

View File

@ -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
}
}
},