From b221a61217e5e8d18afc50d32c495391c07100d8 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 10 Feb 2025 20:55:51 +0100 Subject: Fix macOS locale handling. The docs for wxLocale say it's broken on macOS, and it seems to cause problems when e.g. de_DE is configured in DoM and the computer is set to de_DE locale (and language) - then you can't enter , in wxSpinCtrlDouble and if you type a . and then use the up/down buttons it all goes wrong. It doesn't seem possible to set a configured locale in DoM, but you probably don't want that anyway. wxUILocale::UseDefault() appears to magically fix everything. Unfortunately this is not available in the version of wxWidgets we use for 10.8 and 10.9, and we can't go higher with wxWidgets on those macOS versions. So maybe localisation on 10.{8,9} will be broken, and stay broken. --- src/wx/wx_util.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc index 78fa3f544..1e385c63c 100644 --- a/src/wx/wx_util.cc +++ b/src/wx/wx_util.cc @@ -47,6 +47,9 @@ LIBDCP_DISABLE_WARNINGS #include #include #include +#if wxCHECK_VERSION(3, 1, 6) +#include +#endif LIBDCP_ENABLE_WARNINGS #include @@ -425,6 +428,10 @@ dcpomatic_setup_i18n() { wxLog::EnableLogging(); +#if wxCHECK_VERSION(3, 1, 6) + wxUILocale::UseDefault(); +#endif + auto get_locale_value = [](CFLocaleKey key) { CFLocaleRef cflocale = CFLocaleCopyCurrent(); auto value = (CFStringRef) CFLocaleGetValue(cflocale, key); -- cgit v1.2.3