summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/Main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/DolphinWX/Main.cpp')
-rw-r--r--Source/Core/DolphinWX/Main.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/Source/Core/DolphinWX/Main.cpp b/Source/Core/DolphinWX/Main.cpp
index 20460e258c..12938544d6 100644
--- a/Source/Core/DolphinWX/Main.cpp
+++ b/Source/Core/DolphinWX/Main.cpp
@@ -295,11 +295,23 @@ void DolphinApp::AfterInit()
void DolphinApp::InitLanguageSupport()
{
- unsigned int language = 0;
-
- IniFile ini;
- ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX));
- ini.GetOrCreateSection("Interface")->Get("Language", &language, wxLANGUAGE_DEFAULT);
+ std::string language_code;
+ {
+ IniFile ini;
+ ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX));
+ ini.GetOrCreateSection("Interface")->Get("LanguageCode", &language_code, "");
+ }
+ int language = wxLANGUAGE_UNKNOWN;
+ if (language_code.empty())
+ {
+ language = wxLANGUAGE_DEFAULT;
+ }
+ else
+ {
+ const wxLanguageInfo* language_info = wxLocale::FindLanguageInfo(StrToWxStr(language_code));
+ if (language_info)
+ language = language_info->Language;
+ }
// Load language if possible, fall back to system default otherwise
if (wxLocale::IsAvailable(language))