git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51625
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
/* static */
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;
switch ( index )
{