mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-11-25 18:46:55 +01:00
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
BIN
bin/resources/en/cemu.mo
Normal file
BIN
bin/resources/en/cemu.mo
Normal file
Binary file not shown.
@ -115,22 +115,24 @@ bool CemuApp::OnInit()
|
||||
m_languages = GetAvailableLanguages();
|
||||
|
||||
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; });
|
||||
if (it != m_languages.end() && wxLocale::IsAvailable(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 (m_locale.Init(language))
|
||||
{
|
||||
if (m_locale.Init(language))
|
||||
{
|
||||
m_locale.AddCatalogLookupPathPrefix(ActiveSettings::GetDataPath("resources").generic_string());
|
||||
m_locale.AddCatalog("cemu");
|
||||
}
|
||||
m_locale.AddCatalogLookupPathPrefix(ActiveSettings::GetDataPath("resources").generic_string());
|
||||
m_locale.AddCatalog("cemu");
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user