mmg: initialize wxLocale with English if none/unknown selected

This commit is contained in:
Moritz Bunkus 2014-01-12 20:57:37 +01:00
parent da82a20dcc
commit 4246ab4e78

View File

@ -115,11 +115,11 @@ mmg_app::init_ui_locale() {
std::string installation_path = get_installation_path();
if (!installation_path.empty())
wxLocale::AddCatalogLookupPathPrefix(wxU(installation_path + "/locale"));
}
const wxLanguageInfo *lang_info = wxLocale::FindLanguageInfo(wxU(m_ui_locale));
if (s_first_init) {
if (lang_info && m_locale.Init(lang_info->Language)) {
auto lang_info = !m_ui_locale.empty() ? wxLocale::FindLanguageInfo(wxU(m_ui_locale)) : nullptr;
auto language = lang_info ? lang_info->Language : wxLANGUAGE_ENGLISH;
if (lang_info && m_locale.Init(language)) {
m_locale.AddCatalog(wxU("wxstd"));
#ifdef SYS_WINDOWS
m_locale.AddCatalog(wxU("wxmsw"));