diff --git a/romfs/lang/de.json b/romfs/lang/de.json index 507834c..fdfbdaf 100644 --- a/romfs/lang/de.json +++ b/romfs/lang/de.json @@ -197,7 +197,7 @@ }, "credits": { "title": "Vielen Dank an die folgenden Leute!", - "desc": "TinWoo - MrDude\nTinleaf - BlaWar\nAwoo Installer - Huntereb\nHard Drive Support - DarkMatterCore\n\n\nhttps://github.com/Huntereb/Awoo-Installer\nhttps://github.com/blawar/tinleaf\nhttps://github.com/DarkMatterCore/libusbhsfs\n\nThanks for testing - LyuboA" + "desc": "TinWoo - MrDude\nXorTroll - Plutonium\nTinleaf - BlaWar\nAwoo Installer - Huntereb\nHard Drive Support - DarkMatterCore\n\n\nhttps://github.com/Huntereb/Awoo-Installer\nhttps://github.com/blawar/tinleaf\nhttps://github.com/DarkMatterCore/libusbhsfs\n\nThanks for testing - LyuboA" }, "language": { "title": "Wähle TinWoo Installer Sprache", diff --git a/romfs/lang/en.json b/romfs/lang/en.json index 827aa2a..44b3cb1 100644 --- a/romfs/lang/en.json +++ b/romfs/lang/en.json @@ -197,7 +197,7 @@ }, "credits": { "title": "Thanks to the following!", - "desc": "TinWoo - MrDude\nTinleaf - BlaWar\nAwoo Installer - Huntereb\nHard Drive Support - DarkMatterCore\n\n\nhttps://github.com/Huntereb/Awoo-Installer\nhttps://github.com/blawar/tinleaf\nhttps://github.com/DarkMatterCore/libusbhsfs\n\nThanks for testing - LyuboA" + "desc": "TinWoo - MrDude\nXorTroll - Plutonium\nTinleaf - BlaWar\nAwoo Installer - Huntereb\nHard Drive Support - DarkMatterCore\n\n\nhttps://github.com/Huntereb/Awoo-Installer\nhttps://github.com/blawar/tinleaf\nhttps://github.com/DarkMatterCore/libusbhsfs\n\nThanks for testing - LyuboA" }, "language": { "title": "Select TinWoo Installer's language", diff --git a/romfs/lang/fr.json b/romfs/lang/fr.json index 587172a..41a3c1e 100644 --- a/romfs/lang/fr.json +++ b/romfs/lang/fr.json @@ -197,7 +197,7 @@ }, "credits": { "title": "Merci aux personnes suivantes !", - "desc": "TinWoo - MrDude\nTinleaf - BlaWar\nAwoo Installer - Huntereb\nHard Drive Support - DarkMatterCore\n\n\nhttps://github.com/Huntereb/Awoo-Installer\nhttps://github.com/blawar/tinleaf\nhttps://github.com/DarkMatterCore/libusbhsfs\n\nThanks for testing - LyuboA" + "desc": "TinWoo - MrDude\nXorTroll - Plutonium\nTinleaf - BlaWar\nAwoo Installer - Huntereb\nHard Drive Support - DarkMatterCore\n\n\nhttps://github.com/Huntereb/Awoo-Installer\nhttps://github.com/blawar/tinleaf\nhttps://github.com/DarkMatterCore/libusbhsfs\n\nThanks for testing - LyuboA" }, "language": { "title": "Sélectionnez la langue de TinWoo Installer", diff --git a/romfs/lang/it.json b/romfs/lang/it.json index 560c193..62bfb27 100644 --- a/romfs/lang/it.json +++ b/romfs/lang/it.json @@ -197,7 +197,7 @@ }, "credits": { "title": "Un ringraziamento alle seguenti persone!", - "desc": "TinWoo - MrDude\nTinleaf - BlaWar\nAwoo Installer - Huntereb\nHard Drive Support - DarkMatterCore\n\n\nhttps://github.com/Huntereb/Awoo-Installer\nhttps://github.com/blawar/tinleaf\nhttps://github.com/DarkMatterCore/libusbhsfs\n\nThanks for testing - LyuboA" + "desc": "TinWoo - MrDude\nXorTroll - Plutonium\nTinleaf - BlaWar\nAwoo Installer - Huntereb\nHard Drive Support - DarkMatterCore\n\n\nhttps://github.com/Huntereb/Awoo-Installer\nhttps://github.com/blawar/tinleaf\nhttps://github.com/DarkMatterCore/libusbhsfs\n\nThanks for testing - LyuboA" }, "language": { "title": "Seleziona la lingua di TinWoo Installer", diff --git a/romfs/lang/jp.json b/romfs/lang/jp.json index e8a4789..9be3d34 100644 --- a/romfs/lang/jp.json +++ b/romfs/lang/jp.json @@ -197,7 +197,7 @@ }, "credits": { "title": "以下の方々に感謝します!", - "desc": "TinWoo - MrDude\nTinleaf - BlaWar\nAwoo Installer - Huntereb\nHard Drive Support - DarkMatterCore\n\n\nhttps://github.com/Huntereb/Awoo-Installer\nhttps://github.com/blawar/tinleaf\nhttps://github.com/DarkMatterCore/libusbhsfs\n\nThanks for testing - LyuboA" + "desc": "TinWoo - MrDude\nXorTroll - Plutonium\nTinleaf - BlaWar\nAwoo Installer - Huntereb\nHard Drive Support - DarkMatterCore\n\n\nhttps://github.com/Huntereb/Awoo-Installer\nhttps://github.com/blawar/tinleaf\nhttps://github.com/DarkMatterCore/libusbhsfs\n\nThanks for testing - LyuboA" }, "language": { "title": "TinWoo Installerの言語を選択", diff --git a/romfs/lang/ru.json b/romfs/lang/ru.json index bbd18cb..17ca6ee 100644 --- a/romfs/lang/ru.json +++ b/romfs/lang/ru.json @@ -197,7 +197,7 @@ }, "credits": { "title": "Выражаем благодарность следующим людям:", - "desc": "TinWoo - MrDude\nTinleaf - BlaWar\nAwoo Installer - Huntereb\nHard Drive Support - DarkMatterCore\n\n\nhttps://github.com/Huntereb/Awoo-Installer\nhttps://github.com/blawar/tinleaf\nhttps://github.com/DarkMatterCore/libusbhsfs\n\nThanks for testing - LyuboA" + "desc": "TinWoo - MrDude\nXorTroll - Plutonium\nTinleaf - BlaWar\nAwoo Installer - Huntereb\nHard Drive Support - DarkMatterCore\n\n\nhttps://github.com/Huntereb/Awoo-Installer\nhttps://github.com/blawar/tinleaf\nhttps://github.com/DarkMatterCore/libusbhsfs\n\nThanks for testing - LyuboA" }, "language": { "title": "Выбор языка", diff --git a/source/ui/mainPage.cpp b/source/ui/mainPage.cpp index e64201a..16f5981 100644 --- a/source/ui/mainPage.cpp +++ b/source/ui/mainPage.cpp @@ -265,7 +265,8 @@ namespace inst::ui { } if (Down & HidNpadButton_A) { - switch (this->optionMenu->GetSelectedIndex()) { + int menuindex = this->optionMenu->GetSelectedIndex(); + switch (menuindex) { case 0: this->installMenuItem_Click(); break; diff --git a/source/ui/optionsPage.cpp b/source/ui/optionsPage.cpp index 4f9b6e2..69441e9 100644 --- a/source/ui/optionsPage.cpp +++ b/source/ui/optionsPage.cpp @@ -18,7 +18,7 @@ namespace inst::ui { extern MainApplication *mainApp; - std::vector languageStrings = {"English", "日本語", "Français", "Deutsch", "Italiano", "Русский"}; + std::vector languageStrings = {"En", "Jpn", "Fr", "De", "It", "Ru", "Zh"}; optionsPage::optionsPage() : Layout::Layout() { this->infoRect = Rectangle::New(0, 95, 1280, 60, COLOR("#00000080")); @@ -88,24 +88,10 @@ namespace inst::ui { } std::string optionsPage::getMenuLanguage(int ourLangCode) { - switch (ourLangCode) { - case 1: - case 12: - return languageStrings[0]; - case 0: - return languageStrings[1]; - case 2: - case 13: - return languageStrings[2]; - case 3: - return languageStrings[3]; - case 4: - return languageStrings[4]; - case 10: - return languageStrings[5]; - default: - return "options.language.system_language"_lang; - } + if (ourLangCode >= 0) return languageStrings[ourLangCode]; + else { + return "options.language.system_language"_lang; + } } void sigPatchesMenuItem_Click() { @@ -113,7 +99,6 @@ namespace inst::ui { } void thememessage() { - //inst::ui::mainApp->CreateShowDialog("main.theme.title"_lang, "main.theme.desc"_lang, {"common.ok"_lang}, true); int ourResult = inst::ui::mainApp->CreateShowDialog("main.theme.title"_lang, "main.theme.desc"_lang, {"common.ok"_lang, "common.cancel"_lang}, true); if (ourResult != 0) { // @@ -185,12 +170,15 @@ namespace inst::ui { int rc; std::vector downloadUrl; std::vector languageList; - switch (this->menu->GetSelectedIndex()) { - case 0: + int index = this->menu->GetSelectedIndex(); + switch (index) { + case 0: inst::config::ignoreReqVers = !inst::config::ignoreReqVers; inst::config::setConfig(); this->setMenuText(); - this->menu->SetSelectedIndex(0); + //makes sure to jump back to the selected item once the menu is reloaded + this->menu->SetSelectedIndex(index); + // break; case 1: if (inst::config::validateNCAs) { @@ -198,25 +186,25 @@ namespace inst::ui { } else inst::config::validateNCAs = true; inst::config::setConfig(); this->setMenuText(); - this->menu->SetSelectedIndex(1); + this->menu->SetSelectedIndex(index); break; case 2: inst::config::overClock = !inst::config::overClock; inst::config::setConfig(); this->setMenuText(); - this->menu->SetSelectedIndex(2); + this->menu->SetSelectedIndex(index); break; case 3: inst::config::deletePrompt = !inst::config::deletePrompt; inst::config::setConfig(); this->setMenuText(); - this->menu->SetSelectedIndex(3); + this->menu->SetSelectedIndex(index); break; case 4: inst::config::autoUpdate = !inst::config::autoUpdate; inst::config::setConfig(); this->setMenuText(); - this->menu->SetSelectedIndex(4); + this->menu->SetSelectedIndex(index); break; case 5: if (inst::config::gayMode) { @@ -229,7 +217,7 @@ namespace inst::ui { mainApp->mainPage->awooImage->SetVisible(true); } this->setMenuText(); - this->menu->SetSelectedIndex(5); + this->menu->SetSelectedIndex(index); thememessage(); inst::config::setConfig(); break; @@ -242,7 +230,7 @@ namespace inst::ui { inst::config::useSound = true; } this->setMenuText(); - this->menu->SetSelectedIndex(6); + this->menu->SetSelectedIndex(index); inst::config::setConfig(); break; @@ -255,7 +243,7 @@ namespace inst::ui { inst::config::sigPatchesUrl = keyboardResult; inst::config::setConfig(); this->setMenuText(); - this->menu->SetSelectedIndex(8); + this->menu->SetSelectedIndex(index); } break; case 9: @@ -263,28 +251,13 @@ namespace inst::ui { languageList.push_back("options.language.system_language"_lang); rc = inst::ui::mainApp->CreateShowDialog("options.language.title"_lang, "options.language.desc"_lang, languageList, false); if (rc == -1) break; - switch(rc) { - case 0: - inst::config::languageSetting = 1; - break; - case 1: - inst::config::languageSetting = 0; - break; - case 2: - inst::config::languageSetting = 2; - break; - case 3: - inst::config::languageSetting = 3; - break; - case 4: - inst::config::languageSetting = 4; - break; - case 5: - inst::config::languageSetting = 10; - break; - default: - inst::config::languageSetting = 99; + if (rc < 99) { + inst::config::languageSetting = (rc); } + else { + inst::config::languageSetting = 99; + } + inst::config::setConfig(); mainApp->FadeOut(); mainApp->Close(); diff --git a/source/util/lang.cpp b/source/util/lang.cpp index 1867495..8625684 100644 --- a/source/util/lang.cpp +++ b/source/util/lang.cpp @@ -22,10 +22,12 @@ namespace Language { } switch (langInt) { case 0: + languagePath = "romfs:/lang/en.json"; + break; + case 1: languagePath = "romfs:/lang/jp.json"; break; case 2: - case 13: languagePath = "romfs:/lang/fr.json"; break; case 3: @@ -35,26 +37,10 @@ namespace Language { languagePath = "romfs:/lang/it.json"; break; case 5: - case 14: - languagePath = "romfs:/lang/es.json"; - break; - case 6: - languagePath = "romfs:/lang/zh-CN.json"; - break; - case 7: - languagePath = "romfs:/lang/ko.json"; - break; - case 8: - languagePath = "romfs:/lang/nl.json"; - break; - case 9: - languagePath = "romfs:/lang/pt.json"; - break; - case 10: languagePath = "romfs:/lang/ru.json"; break; - case 11: - languagePath = "romfs:/lang/zh-TW.json"; + case 6: + languagePath = "romfs:/lang/zh-rTW.json"; break; default: languagePath = "romfs:/lang/en.json";