- wxLogLastError(wxT("SetThreadLocale"));
- wxLogError(wxT("Cannot set locale to language %s."), name.c_str());
- return FALSE;
+ // Windows9X doesn't support SetThreadLocale, so we must
+ // translate LCID to CRT's setlocale string ourselves
+ locale.Empty();
+ if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
+ {
+ wxChar buffer[256];
+ buffer[0] = wxT('\0');
+ GetLocaleInfo(lcid, LOCALE_SENGLANGUAGE, buffer, 256);
+ locale << buffer;
+ buffer[0] = wxT('\0');
+ GetLocaleInfo(lcid, LOCALE_SENGCOUNTRY, buffer, 256);
+ }
+ if (locale.IsEmpty())
+ {
+ wxLogLastError(wxT("SetThreadLocale"));
+ wxLogError(wxT("Cannot set locale to language %s."), name.c_str());
+ return FALSE;
+ }
+ else
+ retloc = wxSetlocale(LC_ALL, locale);