wxS("no locale to set in wxLocale::Init()") );
}
-#ifdef __WXWINCE__
- // FIXME: I'm guessing here
- wxChar localeName[256];
- int ret = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SLANGUAGE, localeName,
- 256);
- if (ret != 0)
- {
- m_pszOldLocale = wxStrdup(wxConvLibc.cWC2MB(localeName));
- }
- else
- m_pszOldLocale = NULL;
-
- // TODO: how to find languageId
- // SetLocaleInfo(languageId, SORT_DEFAULT, localeName);
-#else
const char *oldLocale = wxSetlocale(LC_ALL, szLocale);
if ( oldLocale )
m_pszOldLocale = wxStrdup(oldLocale);
else
m_pszOldLocale = NULL;
-#endif
if ( m_pszOldLocale == NULL )
wxLogError(_("locale '%s' can not be set."), szLocale);
{
const wxUint32 lcid = info->GetLCID();
- // FIXME
+ // Windows CE doesn't have SetThreadLocale() and there doesn't seem
+ // to be any equivalent
#ifndef __WXWINCE__
// change locale used by Windows functions
::SetThreadLocale(lcid);
#endif
+
// and also call setlocale() to change locale used by the CRT
locale = info->GetLocaleName();
if ( locale.empty() )
}
else // have a valid locale
{
- // FIXME
-#ifndef __WXWINCE__
retloc = wxSetlocale(LC_ALL, locale);
-#endif
+
#ifdef SETLOCALE_FAILS_ON_UNICODE_LANGS
if ( !retloc )
{
}
else
{
- // FIXME
-#ifndef __WXWINCE__
retloc = wxSetlocale(LC_ALL, wxEmptyString);
-#else
- retloc = NULL;
-#endif
+
#ifdef SETLOCALE_FAILS_ON_UNICODE_LANGS
if (retloc == NULL)
{
retloc = "C";
}
}
-#endif
+#endif // SETLOCALE_FAILS_ON_UNICODE_LANGS
}
if ( !retloc )
wxString wxLocale::GetSysName() const
{
- // FIXME
-#ifndef __WXWINCE__
return wxSetlocale(LC_ALL, NULL);
-#else
- return wxEmptyString;
-#endif
}
// clean up
// restore old locale pointer
wxSetLocale(m_pOldLocale);
- // FIXME
-#ifndef __WXWINCE__
wxSetlocale(LC_ALL, m_pszOldLocale);
-#endif
free((wxChar *)m_pszOldLocale); // const_cast
}