mirror of https://github.com/cemu-project/Cemu.git
Fix Cannot set locale to "" (#366)
* Add en resource and change language selection for macos user that don't have US as their system region * default to English if the system language is unavailable
This commit is contained in:
parent
ada8bbb3b4
commit
df0e2f7881
Binary file not shown.
|
@ -115,8 +115,6 @@ bool CemuApp::OnInit()
|
||||||
m_languages = GetAvailableLanguages();
|
m_languages = GetAvailableLanguages();
|
||||||
|
|
||||||
const sint32 language = GetConfig().language;
|
const sint32 language = GetConfig().language;
|
||||||
if (language != wxLANGUAGE_ENGLISH)
|
|
||||||
{
|
|
||||||
const auto it = std::find_if(m_languages.begin(), m_languages.end(), [language](const wxLanguageInfo* info) { return info->Language == language; });
|
const auto it = std::find_if(m_languages.begin(), m_languages.end(), [language](const wxLanguageInfo* info) { return info->Language == language; });
|
||||||
if (it != m_languages.end() && wxLocale::IsAvailable(language))
|
if (it != m_languages.end() && wxLocale::IsAvailable(language))
|
||||||
{
|
{
|
||||||
|
@ -126,11 +124,15 @@ bool CemuApp::OnInit()
|
||||||
m_locale.AddCatalog("cemu");
|
m_locale.AddCatalog("cemu");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!m_locale.IsOk())
|
if (!m_locale.IsOk())
|
||||||
{
|
{
|
||||||
m_locale.Init(wxLANGUAGE_DEFAULT);
|
if (!wxLocale::IsAvailable(wxLANGUAGE_DEFAULT) || !m_locale.Init(wxLANGUAGE_DEFAULT))
|
||||||
|
{
|
||||||
|
m_locale.Init(wxLANGUAGE_ENGLISH);
|
||||||
|
m_locale.AddCatalogLookupPathPrefix(ActiveSettings::GetDataPath("resources").generic_string());
|
||||||
|
m_locale.AddCatalog("cemu");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// fill colour db
|
// fill colour db
|
||||||
|
|
Loading…
Reference in New Issue