From eeadd5c98d536695099c1da99daa9f99c36f7d6e Mon Sep 17 00:00:00 2001 From: Sam Toki Date: Thu, 7 Nov 2024 23:13:47 +0800 Subject: [PATCH] Language settings optimization. --- PROJECT/KanaMaster/scripts/script.js | 9 +++++---- PROJECT/scripts/common.js | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/PROJECT/KanaMaster/scripts/script.js b/PROJECT/KanaMaster/scripts/script.js index e3f61d6..73b6982 100644 --- a/PROJECT/KanaMaster/scripts/script.js +++ b/PROJECT/KanaMaster/scripts/script.js @@ -125,11 +125,14 @@ function Load() { if(localStorage.System != undefined) { System = JSON.parse(localStorage.getItem("System")); - } else { - System.I18n.Language = "zh-CN"; } switch(System.I18n.Language) { + case "Auto": + /* navigator.language ... */ + break; case "en-US": + /* ChangeCursorOverall("wait"); + window.location.replace("index_" + System.I18n.Language + ".html"); */ ShowDialog("System_LanguageUnsupported", "Error", "Sorry, this page currently does not support English (US).", @@ -142,8 +145,6 @@ "", "", "", "OK"); break; case "zh-CN": - /* ChangeCursorOverall("wait"); - window.location.replace("index.html"); */ break; case "zh-TW": ShowDialog("System_LanguageUnsupported", diff --git a/PROJECT/scripts/common.js b/PROJECT/scripts/common.js index adab8c4..fe3c2c7 100644 --- a/PROJECT/scripts/common.js +++ b/PROJECT/scripts/common.js @@ -39,7 +39,7 @@ PlayAudio: true }, I18n: { - Language: "Unset" + Language: "Auto" }, Dev: { TryToOptimizePerformance: false,