/*static*/ void wxLocale::DestroyLanguagesDB()
{
- delete ms_languagesDB;
- ms_languagesDB = NULL;
+ wxDELETE(ms_languagesDB);
}
const wxString& locale,
bool bLoadDefault
#if WXWIN_COMPATIBILITY_2_8
- ,bool bConvertEncoding
+ ,bool WXUNUSED_UNLESS_DEBUG(bConvertEncoding)
#endif
)
{
if ( m_pszOldLocale == NULL )
{
- wxLogError(_("locale '%s' can not be set."), szLocale);
+ wxLogError(_("locale '%s' cannot be set."), szLocale);
}
// the short name will be used to look for catalog files as well,
wxSetLocale(m_pOldLocale);
wxSetlocale(LC_ALL, m_pszOldLocale);
- free((wxChar *)m_pszOldLocale); // const_cast
+ free(const_cast<char *>(m_pszOldLocale));
}
} // anonymous namespace
/* static */
-wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory WXUNUSED(cat))
+wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory cat)
{
wxUint32 lcid = LOCALE_USER_DEFAULT;
if ( wxGetLocale() )
switch ( index )
{
+ case wxLOCALE_THOUSANDS_SEP:
+ if ( ::GetLocaleInfo(lcid, LOCALE_STHOUSAND, buf, WXSIZEOF(buf)) )
+ str = buf;
+ break;
+
case wxLOCALE_DECIMAL_POINT:
- if ( ::GetLocaleInfo(lcid, LOCALE_SDECIMAL, buf, WXSIZEOF(buf)) )
+ if ( ::GetLocaleInfo(lcid,
+ cat == wxLOCALE_CAT_MONEY
+ ? LOCALE_SMONDECIMALSEP
+ : LOCALE_SDECIMAL,
+ buf,
+ WXSIZEOF(buf)) )
str = buf;
break;