Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Manager] Show native names for language options, and only those for which translations are available #5176

Merged
merged 13 commits into from
May 26, 2023
Merged
Prev Previous commit
Next Next commit
Make locale initialization more robust
BrianNixon committed Mar 31, 2023

Verified

This commit was signed with the committer’s verified signature.
scala-steward Scala Steward
commit e6efe95e6fae8872b64e5f0da9bb25d33836bb97
15 changes: 11 additions & 4 deletions clientgui/BOINCGUIApp.cpp
Original file line number Diff line number Diff line change
@@ -265,12 +265,19 @@ bool CBOINCGUIApp::OnInit() {
wxASSERT(m_pLocale);

//
if (m_strISOLanguageCode.IsEmpty()) {
if (!m_strISOLanguageCode.IsEmpty()) {
const wxLanguageInfo* pLI = wxLocale::FindLanguageInfo(m_strISOLanguageCode);
if (pLI) {
iDesiredLanguageCode = pLI->Language;
} else {
iDesiredLanguageCode = wxLANGUAGE_DEFAULT;
}
} else {
iDesiredLanguageCode = wxLANGUAGE_DEFAULT;
m_pLocale->Init(iDesiredLanguageCode);
}
m_pLocale->Init(iDesiredLanguageCode);
if (iDesiredLanguageCode == wxLANGUAGE_DEFAULT) {
m_strISOLanguageCode = m_pLocale->GetCanonicalName();
} else {
m_pLocale->Init(wxLocale::FindLanguageInfo(m_strISOLanguageCode)->Language);
}

// Look for the localization files by absolute and relative locations.