Fixed GetInfo to use the current language.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51136 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2590,6 +2590,18 @@ bool wxLocale::AddCatalog(const wxString& szDomain,
|
||||
/* static */
|
||||
wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory WXUNUSED(cat))
|
||||
{
|
||||
wxUint32 lcid = LOCALE_USER_DEFAULT;
|
||||
|
||||
if (wxGetLocale())
|
||||
{
|
||||
const wxLanguageInfo *info = GetLanguageInfo(wxGetLocale()->GetLanguage());
|
||||
if (info)
|
||||
{ ;
|
||||
lcid = MAKELCID(MAKELANGID(info->WinLang, info->WinSublang),
|
||||
SORT_DEFAULT);
|
||||
}
|
||||
}
|
||||
|
||||
wxString str;
|
||||
wxChar buffer[256];
|
||||
size_t count;
|
||||
@@ -2597,7 +2609,7 @@ wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory WXUNUSED(cat))
|
||||
switch (index)
|
||||
{
|
||||
case wxLOCALE_DECIMAL_POINT:
|
||||
count = ::GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, buffer, 256);
|
||||
count = ::GetLocaleInfo(lcid, LOCALE_SDECIMAL, buffer, 256);
|
||||
if (!count)
|
||||
str << wxS(".");
|
||||
else
|
||||
@@ -2605,14 +2617,14 @@ wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory WXUNUSED(cat))
|
||||
break;
|
||||
#if 0
|
||||
case wxSYS_LIST_SEPARATOR:
|
||||
count = ::GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SLIST, buffer, 256);
|
||||
count = ::GetLocaleInfo(lcid, LOCALE_SLIST, buffer, 256);
|
||||
if (!count)
|
||||
str << wxS(",");
|
||||
else
|
||||
str << buffer;
|
||||
break;
|
||||
case wxSYS_LEADING_ZERO: // 0 means no leading zero, 1 means leading zero
|
||||
count = ::GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_ILZERO, buffer, 256);
|
||||
count = ::GetLocaleInfo(lcid, LOCALE_ILZERO, buffer, 256);
|
||||
if (!count)
|
||||
str << wxS("0");
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user