From 521b5151e98a1fc8c01685875190714ea8c44a02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Fri, 20 Jan 2023 07:38:12 +0100 Subject: [PATCH 1/2] Fix assuming wrong system language on macOS, fixes #11195 --- src/util/translations.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/util/translations.h b/src/util/translations.h index f803e178379..f31afdd992d 100644 --- a/src/util/translations.h +++ b/src/util/translations.h @@ -43,6 +43,13 @@ class Translations { } QLocale::setDefault(customLocale); } +#if defined(__APPLE__) && (QT_VERSION < QT_VERSION_CHECK(6, 2, 0)) + else { + // Workaround https://github.com/mixxxdj/mixxx/issues/11195 and + // QTBUG-90971 fixed in Qt 6.2 + QLocale::setDefault(QLocale(QLocale::system().name())); + } +#endif // Constructs a QLocale object initialized with the default locale. If // no default locale was set using setDefault(), this locale will be From 5dceb8f205b19c985060ac5c956f49508fdcfd6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Thu, 26 Jan 2023 08:37:00 +0100 Subject: [PATCH 2/2] Use enums to create the new default locale Co-authored-by: Swiftb0y <12380386+Swiftb0y@users.noreply.github.com> --- src/util/translations.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/translations.h b/src/util/translations.h index f31afdd992d..afde57b2423 100644 --- a/src/util/translations.h +++ b/src/util/translations.h @@ -47,7 +47,8 @@ class Translations { else { // Workaround https://github.com/mixxxdj/mixxx/issues/11195 and // QTBUG-90971 fixed in Qt 6.2 - QLocale::setDefault(QLocale(QLocale::system().name())); + const auto sysLocale = QLocale::system(); + QLocale::setDefault(QLocale(sysLocale.language(), sysLocale.country())); } #endif