From 59a4505a5fe23083db169b0fb50c73c4d8836443 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 14 Aug 2021 19:06:14 +0200 Subject: [PATCH] Use Core Foundation for testing locale availability under Mac Using setlocale() is not the right way to do it there, try checking if the locale is supported by Core Foundation instead of whether it's supported by the Unix layer which is neglected and not used under Mac. --- src/common/intl.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/common/intl.cpp b/src/common/intl.cpp index cc8588ba31..4d900c45ad 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -1131,6 +1131,13 @@ bool wxLocale::IsAvailable(int lang) if ( !::IsValidLocale(info->GetLCID(), LCID_INSTALLED) ) return false; +#elif defined(__WXOSX__) + CFLocaleRef + cfloc = CFLocaleCreate(kCFAllocatorDefault, wxCFStringRef(info->CanonicalName)); + if ( !cfloc ) + return false; + + CFRelease(cfloc); #elif defined(__UNIX__) // Test if setting the locale works, then set it back.