Fix GetSystemLocale() return value for "C" locale
This was broken by the recent changes, so fix it again: we do still want to return wxLANGUAGE_ENGLISH_US for this particular locale.
This commit is contained in:
parent
2ca76449bf
commit
3dfe253d3c
1 changed files with 7 additions and 3 deletions
|
|
@ -693,10 +693,14 @@ int wxUILocale::GetSystemLocale()
|
|||
// fallback on the language, which is something that it generally makes
|
||||
// sense for FindLanguageInfo() to do, but in this case we really need the
|
||||
// locale.
|
||||
if ( defaultLanguage &&
|
||||
locId.GetTag(wxLOCALE_TAGTYPE_BCP47) == defaultLanguage->LocaleTag )
|
||||
if ( defaultLanguage )
|
||||
{
|
||||
return defaultLanguage->Language;
|
||||
// We have to handle the "C" locale specially as its name is different
|
||||
// from the "en-US" tag found for it, but we do still want to return
|
||||
// English for it.
|
||||
const wxString tag = locId.GetTag(wxLOCALE_TAGTYPE_BCP47);
|
||||
if ( tag == defaultLanguage->LocaleTag || IsDefaultCLocale(tag) )
|
||||
return defaultLanguage->Language;
|
||||
}
|
||||
|
||||
return wxLANGUAGE_UNKNOWN;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue