Check for C/POSIX locale just after we truncate language string

This way we can correctly detect C.UTF-8 as C locale.

See https://github.com/wxWidgets/wxWidgets/pull/262

(cherry picked from commit 467dc72fc2)
This commit is contained in:
İsmail Dönmez
2016-03-29 13:59:04 +03:00
committed by Vadim Zeitlin
parent 34c54237fc
commit f358979d35

View File

@@ -629,11 +629,6 @@ inline bool wxGetNonEmptyEnvVar(const wxString& name, wxString* value)
return wxLANGUAGE_ENGLISH_US;
}
if ( langFull == wxS("C") || langFull == wxS("POSIX") )
{
// default C locale is English too
return wxLANGUAGE_ENGLISH_US;
}
#endif
// the language string has the following form
@@ -669,6 +664,12 @@ inline bool wxGetNonEmptyEnvVar(const wxString& name, wxString* value)
langFull.Truncate(posEndLang);
}
if ( langFull == wxS("C") || langFull == wxS("POSIX") )
{
// default C locale is English too
return wxLANGUAGE_ENGLISH_US;
}
// do we have just the language (or sublang too)?
const bool justLang = langFull.find('_') == wxString::npos;