Handle wxLANGUAGE_DEFAULT in wxLocale specially under MSW too
Even if we do know about the system language, it's still better to let OS/CRT handle it, as we may not know enough about it. E.g. "system language" may actually be a mix of the different languages and formats and we don't handle this case at all, while OS/CRT do just fine.
This commit is contained in:
@@ -547,10 +547,14 @@ bool wxLocale::Init(int lang, int flags)
|
|||||||
|
|
||||||
#elif defined(__WIN32__)
|
#elif defined(__WIN32__)
|
||||||
const char *retloc;
|
const char *retloc;
|
||||||
if ( !info )
|
if ( lang == wxLANGUAGE_DEFAULT )
|
||||||
{
|
{
|
||||||
// We're using the system language, but we don't know what it is, so
|
::SetThreadLocale(LOCALE_USER_DEFAULT);
|
||||||
// just use setlocale() to deal with it.
|
wxMSWSetThreadUILanguage(LANG_USER_DEFAULT);
|
||||||
|
|
||||||
|
// We're using the system language, so let setlocale() deal with it: it
|
||||||
|
// does it better than we do and we might not even know about this
|
||||||
|
// language in the first place.
|
||||||
retloc = wxSetlocale(LC_ALL, "");
|
retloc = wxSetlocale(LC_ALL, "");
|
||||||
}
|
}
|
||||||
else if ( info->WinLang == 0 )
|
else if ( info->WinLang == 0 )
|
||||||
|
Reference in New Issue
Block a user