Create wxGetStdCLocaleInfo() function
Extract it from existing MSW-only code and make it available in all ports so that we could use it as a fallback in wxUILocale if everything else fails. No real changes yet.
This commit is contained in:
@@ -1454,6 +1454,35 @@ wxString wxTranslateFromUnicodeFormat(const wxString& fmt)
|
|||||||
|
|
||||||
#endif // __WINDOWS__ || __WXOSX__
|
#endif // __WINDOWS__ || __WXOSX__
|
||||||
|
|
||||||
|
wxString wxGetStdCLocaleInfo(wxLocaleInfo index, wxLocaleCategory WXUNUSED(cat))
|
||||||
|
{
|
||||||
|
switch ( index )
|
||||||
|
{
|
||||||
|
case wxLOCALE_THOUSANDS_SEP:
|
||||||
|
return wxString();
|
||||||
|
|
||||||
|
case wxLOCALE_DECIMAL_POINT:
|
||||||
|
return ".";
|
||||||
|
|
||||||
|
case wxLOCALE_SHORT_DATE_FMT:
|
||||||
|
return "%m/%d/%y";
|
||||||
|
|
||||||
|
case wxLOCALE_LONG_DATE_FMT:
|
||||||
|
return "%A, %B %d, %Y";
|
||||||
|
|
||||||
|
case wxLOCALE_TIME_FMT:
|
||||||
|
return "%H:%M:%S";
|
||||||
|
|
||||||
|
case wxLOCALE_DATE_TIME_FMT:
|
||||||
|
return "%m/%d/%y %H:%M:%S";
|
||||||
|
|
||||||
|
default:
|
||||||
|
wxFAIL_MSG( "unknown wxLocaleInfo" );
|
||||||
|
}
|
||||||
|
|
||||||
|
return wxString();
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(__WINDOWS__)
|
#if defined(__WINDOWS__)
|
||||||
|
|
||||||
// These functions are also used by wxUILocaleImpl, so don't make them private.
|
// These functions are also used by wxUILocaleImpl, so don't make them private.
|
||||||
@@ -1600,29 +1629,7 @@ wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory cat)
|
|||||||
// case, even LOCALE_INVARIANT is not quite the same as C locale (the
|
// case, even LOCALE_INVARIANT is not quite the same as C locale (the
|
||||||
// only difference is that it uses %Y instead of %y in the date format
|
// only difference is that it uses %Y instead of %y in the date format
|
||||||
// but this difference is significant enough).
|
// but this difference is significant enough).
|
||||||
switch ( index )
|
return wxGetStdCLocaleInfo(index, cat);
|
||||||
{
|
|
||||||
case wxLOCALE_THOUSANDS_SEP:
|
|
||||||
return wxString();
|
|
||||||
|
|
||||||
case wxLOCALE_DECIMAL_POINT:
|
|
||||||
return ".";
|
|
||||||
|
|
||||||
case wxLOCALE_SHORT_DATE_FMT:
|
|
||||||
return "%m/%d/%y";
|
|
||||||
|
|
||||||
case wxLOCALE_LONG_DATE_FMT:
|
|
||||||
return "%A, %B %d, %Y";
|
|
||||||
|
|
||||||
case wxLOCALE_TIME_FMT:
|
|
||||||
return "%H:%M:%S";
|
|
||||||
|
|
||||||
case wxLOCALE_DATE_TIME_FMT:
|
|
||||||
return "%m/%d/%y %H:%M:%S";
|
|
||||||
|
|
||||||
default:
|
|
||||||
wxFAIL_MSG( "unknown wxLocaleInfo" );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// wxSetLocale() succeeded and so thread locale was set together with CRT one.
|
// wxSetLocale() succeeded and so thread locale was set together with CRT one.
|
||||||
|
Reference in New Issue
Block a user