diff --git a/src/loading-scene.ts b/src/loading-scene.ts index a8c63778246..bafe7722e21 100644 --- a/src/loading-scene.ts +++ b/src/loading-scene.ts @@ -206,23 +206,19 @@ export class LoadingScene extends SceneBase { this.loadAtlas("items", ""); this.loadAtlas("types", ""); - (i18next.options.supportedLngs as Array).forEach(lang => { - switch (lang) { - case "pt": - lang = "pt_BR"; - break; - case "zh": - lang = "zh_CN"; - break; - } + // Get current lang and load the types atlas for it. English will only load types while all other languages will load types and types_ + const lang = i18next.language; + if (lang !== "en") { if (Utils.verifyLang(lang)) { - if (lang === "zh_CN") { - // Load also the traditional Chinese since it doesn't have a separate language code in supportedLngs - this.loadAtlas("types_zh_TW", ""); - } this.loadAtlas(`types_${lang}`, ""); + } else { + // Fallback to English + this.loadAtlas("types", ""); } - }); + } else { + this.loadAtlas("types", ""); + } + this.loadAtlas("statuses", ""); this.loadAtlas("categories", ""); diff --git a/src/system/settings.ts b/src/system/settings.ts index c0ae9496977..974aee1cbf5 100644 --- a/src/system/settings.ts +++ b/src/system/settings.ts @@ -186,7 +186,8 @@ export function setSetting(scene: BattleScene, setting: Setting, value: integer) i18next.changeLanguage(locale); localStorage.setItem("prLang", locale); cancelHandler(); - scene.reset(true, false, true); + // Reload the whole game to apply the new locale since also some constants are translated + window.location.reload(); return true; } catch (error) { console.error("Error changing locale:", error);