diff options
| author | JosJuice <josjuice@gmail.com> | 2015-04-09 17:44:53 +0200 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2015-04-23 08:14:39 +0200 |
| commit | 235ecfbed71986f0be2ecf469a10e1105dcb3c96 (patch) | |
| tree | 36427d6c1bedd2b695fc3bd68a66743d8c26e33f /Source/Core/DolphinWX/Config/WiiConfigPane.cpp | |
| parent | 87a63713f4f7c583545f23b75ed8395913c8e600 (diff) | |
Return GetNames languages, to avoid hardcoded language lists in callers
This makes the code cleaner and also leads to some user-visible changes:
The wx game properties will no longer let the user
select WAD languages that don't have any names.
The Qt game list will now display names using the languages
set in the configuration instead of always using
English for PAL GC games and Japanese for WADs.
If a WAD doesn't have a name in the user's preferred language,
English is now selected as a fallback before Japanese.
Diffstat (limited to 'Source/Core/DolphinWX/Config/WiiConfigPane.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/Config/WiiConfigPane.cpp | 63 |
1 files changed, 28 insertions, 35 deletions
diff --git a/Source/Core/DolphinWX/Config/WiiConfigPane.cpp b/Source/Core/DolphinWX/Config/WiiConfigPane.cpp index 31b957ce89..b2e08b5bee 100644 --- a/Source/Core/DolphinWX/Config/WiiConfigPane.cpp +++ b/Source/Core/DolphinWX/Config/WiiConfigPane.cpp @@ -11,6 +11,7 @@ #include "Core/ConfigManager.h" #include "Core/Core.h" #include "Core/IPC_HLE/WII_IPC_HLE.h" +#include "DiscIO/Volume.h" #include "DolphinWX/WxUtils.h" #include "DolphinWX/Config/WiiConfigPane.h" @@ -125,7 +126,7 @@ void WiiConfigPane::OnConnectKeyboardCheckBoxChanged(wxCommandEvent& event) void WiiConfigPane::OnSystemLanguageChoiceChanged(wxCommandEvent& event) { - int wii_system_lang = m_system_language_choice->GetSelection(); + IVolume::ELanguage wii_system_lang = (IVolume::ELanguage)m_system_language_choice->GetSelection(); SConfig::GetInstance().m_SYSCONF->SetData("IPL.LNG", wii_system_lang); u8 country_code = GetSADRCountryCode(wii_system_lang); @@ -138,41 +139,33 @@ void WiiConfigPane::OnAspectRatioChoiceChanged(wxCommandEvent& event) SConfig::GetInstance().m_SYSCONF->SetData("IPL.AR", m_aspect_ratio_choice->GetSelection()); } -// Change from IPL.LNG value to IPL.SADR country code -u8 WiiConfigPane::GetSADRCountryCode(int language) +// Change from IPL.LNG value to IPL.SADR country code. +// http://wiibrew.org/wiki/Country_Codes +u8 WiiConfigPane::GetSADRCountryCode(IVolume::ELanguage language) { - //http://wiibrew.org/wiki/Country_Codes - u8 country_code = language; - switch (country_code) + switch (language) { - case 0: //Japanese - country_code = 1; //Japan - break; - case 1: //English - country_code = 49; //USA - break; - case 2: //German - country_code = 78; //Germany - break; - case 3: //French - country_code = 77; //France - break; - case 4: //Spanish - country_code = 105; //Spain - break; - case 5: //Italian - country_code = 83; //Italy - break; - case 6: //Dutch - country_code = 94; //Netherlands - break; - case 7: //Simplified Chinese - case 8: //Traditional Chinese - country_code = 157; //China - break; - case 9: //Korean - country_code = 136; //Korea - break; + case IVolume::LANGUAGE_JAPANESE: + return 1; // Japan + case IVolume::LANGUAGE_ENGLISH: + return 49; // USA + case IVolume::LANGUAGE_GERMAN: + return 78; // Germany + case IVolume::LANGUAGE_FRENCH: + return 77; // France + case IVolume::LANGUAGE_SPANISH: + return 105; // Spain + case IVolume::LANGUAGE_ITALIAN: + return 83; // Italy + case IVolume::LANGUAGE_DUTCH: + return 94; // Netherlands + case IVolume::LANGUAGE_SIMPLIFIED_CHINESE: + case IVolume::LANGUAGE_TRADITIONAL_CHINESE: + return 157; // China + case IVolume::LANGUAGE_KOREAN: + return 136; // Korea } - return country_code; + + PanicAlert("Invalid language"); + return 1; } |
