From 82de050cc30ed687dc5438c47e71ae2944399867 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 10 Feb 2008 00:11:56 +0000 Subject: [PATCH 1/1] 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 --- src/common/intl.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/common/intl.cpp b/src/common/intl.cpp index 8b94852d84..402c20f26a 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -2650,7 +2650,22 @@ wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory WXUNUSED(cat)) /* static */ wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory WXUNUSED(cat)) { - wxCFRef userLocaleRef(CFLocaleCopyCurrent()); + CFLocaleRef userLocaleRefRaw; + if ( wxGetLocale() ) + { + userLocaleRefRaw = CFLocaleCreate + ( + kCFAllocatorDefault, + wxCFStringRef(wxGetLocale()->GetCanonicalName()) + ); + } + else // no current locale, use the default one + { + userLocaleRefRaw = CFLocaleCopyCurrent(); + } + + wxCFRef userLocaleRef(userLocaleRefRaw); + CFTypeRef cfstr; switch ( index ) { -- 2.45.2