use correct locale in GetInfo() under Mac (slightly modified patch 1884290)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51625 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2650,7 +2650,22 @@ wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory WXUNUSED(cat))
|
|||||||
/* static */
|
/* static */
|
||||||
wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory WXUNUSED(cat))
|
wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory WXUNUSED(cat))
|
||||||
{
|
{
|
||||||
wxCFRef<CFLocaleRef> userLocaleRef(CFLocaleCopyCurrent());
|
CFLocaleRef userLocaleRefRaw;
|
||||||
|
if ( wxGetLocale() )
|
||||||
|
{
|
||||||
|
userLocaleRefRaw = CFLocaleCreate
|
||||||
|
(
|
||||||
|
kCFAllocatorDefault,
|
||||||
|
wxCFStringRef(wxGetLocale()->GetCanonicalName())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else // no current locale, use the default one
|
||||||
|
{
|
||||||
|
userLocaleRefRaw = CFLocaleCopyCurrent();
|
||||||
|
}
|
||||||
|
|
||||||
|
wxCFRef<CFLocaleRef> userLocaleRef(userLocaleRefRaw);
|
||||||
|
|
||||||
CFTypeRef cfstr;
|
CFTypeRef cfstr;
|
||||||
switch ( index )
|
switch ( index )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user