Added Chinese + modded language options

This commit is contained in:
mrdude2478 2022-04-28 00:04:16 +01:00
parent 78cc891c97
commit a04cc1c0e2
9 changed files with 37 additions and 77 deletions

View File

@ -197,7 +197,7 @@
}, },
"credits": { "credits": {
"title": "Vielen Dank an die folgenden Leute!", "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": { "language": {
"title": "Wähle TinWoo Installer Sprache", "title": "Wähle TinWoo Installer Sprache",

View File

@ -197,7 +197,7 @@
}, },
"credits": { "credits": {
"title": "Thanks to the following!", "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": { "language": {
"title": "Select TinWoo Installer's language", "title": "Select TinWoo Installer's language",

View File

@ -197,7 +197,7 @@
}, },
"credits": { "credits": {
"title": "Merci aux personnes suivantes !", "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": { "language": {
"title": "Sélectionnez la langue de TinWoo Installer", "title": "Sélectionnez la langue de TinWoo Installer",

View File

@ -197,7 +197,7 @@
}, },
"credits": { "credits": {
"title": "Un ringraziamento alle seguenti persone!", "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": { "language": {
"title": "Seleziona la lingua di TinWoo Installer", "title": "Seleziona la lingua di TinWoo Installer",

View File

@ -197,7 +197,7 @@
}, },
"credits": { "credits": {
"title": "以下の方々に感謝します!", "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": { "language": {
"title": "TinWoo Installerの言語を選択", "title": "TinWoo Installerの言語を選択",

View File

@ -197,7 +197,7 @@
}, },
"credits": { "credits": {
"title": "Выражаем благодарность следующим людям:", "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": { "language": {
"title": "Выбор языка", "title": "Выбор языка",

View File

@ -265,7 +265,8 @@ namespace inst::ui {
} }
if (Down & HidNpadButton_A) { if (Down & HidNpadButton_A) {
switch (this->optionMenu->GetSelectedIndex()) { int menuindex = this->optionMenu->GetSelectedIndex();
switch (menuindex) {
case 0: case 0:
this->installMenuItem_Click(); this->installMenuItem_Click();
break; break;

View File

@ -18,7 +18,7 @@
namespace inst::ui { namespace inst::ui {
extern MainApplication *mainApp; extern MainApplication *mainApp;
std::vector<std::string> languageStrings = {"English", "日本語", "Français", "Deutsch", "Italiano", "Русский"}; std::vector<std::string> languageStrings = {"En", "Jpn", "Fr", "De", "It", "Ru", "Zh"};
optionsPage::optionsPage() : Layout::Layout() { optionsPage::optionsPage() : Layout::Layout() {
this->infoRect = Rectangle::New(0, 95, 1280, 60, COLOR("#00000080")); this->infoRect = Rectangle::New(0, 95, 1280, 60, COLOR("#00000080"));
@ -88,22 +88,8 @@ namespace inst::ui {
} }
std::string optionsPage::getMenuLanguage(int ourLangCode) { std::string optionsPage::getMenuLanguage(int ourLangCode) {
switch (ourLangCode) { if (ourLangCode >= 0) return languageStrings[ourLangCode];
case 1: else {
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; return "options.language.system_language"_lang;
} }
} }
@ -113,7 +99,6 @@ namespace inst::ui {
} }
void thememessage() { 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); int ourResult = inst::ui::mainApp->CreateShowDialog("main.theme.title"_lang, "main.theme.desc"_lang, {"common.ok"_lang, "common.cancel"_lang}, true);
if (ourResult != 0) { if (ourResult != 0) {
// //
@ -185,12 +170,15 @@ namespace inst::ui {
int rc; int rc;
std::vector<std::string> downloadUrl; std::vector<std::string> downloadUrl;
std::vector<std::string> languageList; std::vector<std::string> languageList;
switch (this->menu->GetSelectedIndex()) { int index = this->menu->GetSelectedIndex();
switch (index) {
case 0: case 0:
inst::config::ignoreReqVers = !inst::config::ignoreReqVers; inst::config::ignoreReqVers = !inst::config::ignoreReqVers;
inst::config::setConfig(); inst::config::setConfig();
this->setMenuText(); 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; break;
case 1: case 1:
if (inst::config::validateNCAs) { if (inst::config::validateNCAs) {
@ -198,25 +186,25 @@ namespace inst::ui {
} else inst::config::validateNCAs = true; } else inst::config::validateNCAs = true;
inst::config::setConfig(); inst::config::setConfig();
this->setMenuText(); this->setMenuText();
this->menu->SetSelectedIndex(1); this->menu->SetSelectedIndex(index);
break; break;
case 2: case 2:
inst::config::overClock = !inst::config::overClock; inst::config::overClock = !inst::config::overClock;
inst::config::setConfig(); inst::config::setConfig();
this->setMenuText(); this->setMenuText();
this->menu->SetSelectedIndex(2); this->menu->SetSelectedIndex(index);
break; break;
case 3: case 3:
inst::config::deletePrompt = !inst::config::deletePrompt; inst::config::deletePrompt = !inst::config::deletePrompt;
inst::config::setConfig(); inst::config::setConfig();
this->setMenuText(); this->setMenuText();
this->menu->SetSelectedIndex(3); this->menu->SetSelectedIndex(index);
break; break;
case 4: case 4:
inst::config::autoUpdate = !inst::config::autoUpdate; inst::config::autoUpdate = !inst::config::autoUpdate;
inst::config::setConfig(); inst::config::setConfig();
this->setMenuText(); this->setMenuText();
this->menu->SetSelectedIndex(4); this->menu->SetSelectedIndex(index);
break; break;
case 5: case 5:
if (inst::config::gayMode) { if (inst::config::gayMode) {
@ -229,7 +217,7 @@ namespace inst::ui {
mainApp->mainPage->awooImage->SetVisible(true); mainApp->mainPage->awooImage->SetVisible(true);
} }
this->setMenuText(); this->setMenuText();
this->menu->SetSelectedIndex(5); this->menu->SetSelectedIndex(index);
thememessage(); thememessage();
inst::config::setConfig(); inst::config::setConfig();
break; break;
@ -242,7 +230,7 @@ namespace inst::ui {
inst::config::useSound = true; inst::config::useSound = true;
} }
this->setMenuText(); this->setMenuText();
this->menu->SetSelectedIndex(6); this->menu->SetSelectedIndex(index);
inst::config::setConfig(); inst::config::setConfig();
break; break;
@ -255,7 +243,7 @@ namespace inst::ui {
inst::config::sigPatchesUrl = keyboardResult; inst::config::sigPatchesUrl = keyboardResult;
inst::config::setConfig(); inst::config::setConfig();
this->setMenuText(); this->setMenuText();
this->menu->SetSelectedIndex(8); this->menu->SetSelectedIndex(index);
} }
break; break;
case 9: case 9:
@ -263,28 +251,13 @@ namespace inst::ui {
languageList.push_back("options.language.system_language"_lang); languageList.push_back("options.language.system_language"_lang);
rc = inst::ui::mainApp->CreateShowDialog("options.language.title"_lang, "options.language.desc"_lang, languageList, false); rc = inst::ui::mainApp->CreateShowDialog("options.language.title"_lang, "options.language.desc"_lang, languageList, false);
if (rc == -1) break; if (rc == -1) break;
switch(rc) { if (rc < 99) {
case 0: inst::config::languageSetting = (rc);
inst::config::languageSetting = 1; }
break; else {
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; inst::config::languageSetting = 99;
} }
inst::config::setConfig(); inst::config::setConfig();
mainApp->FadeOut(); mainApp->FadeOut();
mainApp->Close(); mainApp->Close();

View File

@ -22,10 +22,12 @@ namespace Language {
} }
switch (langInt) { switch (langInt) {
case 0: case 0:
languagePath = "romfs:/lang/en.json";
break;
case 1:
languagePath = "romfs:/lang/jp.json"; languagePath = "romfs:/lang/jp.json";
break; break;
case 2: case 2:
case 13:
languagePath = "romfs:/lang/fr.json"; languagePath = "romfs:/lang/fr.json";
break; break;
case 3: case 3:
@ -35,26 +37,10 @@ namespace Language {
languagePath = "romfs:/lang/it.json"; languagePath = "romfs:/lang/it.json";
break; break;
case 5: 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"; languagePath = "romfs:/lang/ru.json";
break; break;
case 11: case 6:
languagePath = "romfs:/lang/zh-TW.json"; languagePath = "romfs:/lang/zh-rTW.json";
break; break;
default: default:
languagePath = "romfs:/lang/en.json"; languagePath = "romfs:/lang/en.json";