1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-26 07:13:49 +01:00

Bug1288: Don't crash when changing language to "Simplified"...

... but give a warning message about the unknown language.
This commit is contained in:
Paul Licameli
2016-01-26 20:09:54 -05:00
parent 2550a59c0e
commit 907c950a0e
4 changed files with 25 additions and 9 deletions

View File

@@ -166,9 +166,12 @@ bool GUIPrefs::Apply()
// If language has changed, we want to change it now, not on the next reboot.
wxString lang = gPrefs->Read(wxT("/Locale/Language"), wxT(""));
if (lang == wxT(""))
lang = GetSystemLanguageCode();
wxGetApp().InitLang(lang);
wxString usedLang = wxGetApp().InitLang(lang);
if (lang != usedLang) {
// lang was not usable. We got overridden.
gPrefs->Write(wxT("/Locale/Language"), usedLang);
gPrefs->Flush();
}
return true;
}