mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-01 18:40:57 -06:00
construct tables as consts
This commit is contained in:
parent
530a0c5794
commit
bc0514d34c
@ -47,39 +47,41 @@ const std::map<std::string, std::string> TrophyEarnedTable = {
|
||||
|
||||
///////////// End ImGui Translation Tables
|
||||
|
||||
std::map<u32, std::string> langMap = {{0, "Japanese"},
|
||||
{1, "English (US)"},
|
||||
{2, "French"},
|
||||
{3, "Spanish"},
|
||||
{4, "German"},
|
||||
{5, "Italian"},
|
||||
{6, "Dutch"},
|
||||
{7, "Portuguese (PT)"},
|
||||
{8, "Russian"},
|
||||
{9, "Korean"},
|
||||
{10, "Chinese (Traditional)"},
|
||||
{11, "Chinese (Simplified)"},
|
||||
{12, "Finnish"},
|
||||
{13, "Swedish"},
|
||||
{14, "Danish"},
|
||||
{15, "Norwegian"},
|
||||
{16, "Polish"},
|
||||
{17, "Portuguese (BR)"},
|
||||
{18, "English (UK)"},
|
||||
{19, "Turkish"},
|
||||
{20, "Spanish (Latin America)"},
|
||||
{21, "Arabic"},
|
||||
{22, "French (Canada)"},
|
||||
{23, "Czech"},
|
||||
{24, "Hungarian"},
|
||||
{25, "Greek"},
|
||||
{26, "Romanian"},
|
||||
{27, "Thai"},
|
||||
{28, "Vietnamese"},
|
||||
{29, "Indonesian"},
|
||||
{30, "Ukrainian"}};
|
||||
const std::map<u32, std::string> langMap = {
|
||||
{0, "Japanese"},
|
||||
{1, "English (US)"},
|
||||
{2, "French"},
|
||||
{3, "Spanish"},
|
||||
{4, "German"},
|
||||
{5, "Italian"},
|
||||
{6, "Dutch"},
|
||||
{7, "Portuguese (PT)"},
|
||||
{8, "Russian"},
|
||||
{9, "Korean"},
|
||||
{10, "Chinese (Traditional)"},
|
||||
{11, "Chinese (Simplified)"},
|
||||
{12, "Finnish"},
|
||||
{13, "Swedish"},
|
||||
{14, "Danish"},
|
||||
{15, "Norwegian"},
|
||||
{16, "Polish"},
|
||||
{17, "Portuguese (BR)"},
|
||||
{18, "English (UK)"},
|
||||
{19, "Turkish"},
|
||||
{20, "Spanish (Latin America)"},
|
||||
{21, "Arabic"},
|
||||
{22, "French (Canada)"},
|
||||
{23, "Czech"},
|
||||
{24, "Hungarian"},
|
||||
{25, "Greek"},
|
||||
{26, "Romanian"},
|
||||
{27, "Thai"},
|
||||
{28, "Vietnamese"},
|
||||
{29, "Indonesian"},
|
||||
{30, "Ukrainian"},
|
||||
};
|
||||
|
||||
std::map<std::string, std::map<std::string, std::string>> tableMap = {
|
||||
const std::map<std::string, std::map<std::string, std::string>> tableMap = {
|
||||
{"Trophy Earned", TrophyEarnedTable},
|
||||
};
|
||||
|
||||
@ -90,13 +92,13 @@ std::string tr(std::string input) {
|
||||
return input;
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> translationTable = tableMap[input];
|
||||
std::string language = langMap[Config::GetLanguage()];
|
||||
const std::map<std::string, std::string> translationTable = tableMap.at(input);
|
||||
std::string language = langMap.at(Config::GetLanguage());
|
||||
if (!translationTable.contains(language)) {
|
||||
return input;
|
||||
}
|
||||
|
||||
return translationTable[language];
|
||||
return translationTable.at(language);
|
||||
}
|
||||
|
||||
} // namespace ImguiTranslate
|
||||
|
||||
Loading…
Reference in New Issue
Block a user