From 2dca7d0ce5ba4045732f3fcd6c8a1170b4ad902f Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 22 Mar 2020 16:25:43 +0100 Subject: locale: store locate to preferences after fixing up mac-weirdness In uiLanguage() the preferences fields are initialized and there is fixup for a MacOS indiosyncrasy. For some reason the uncorrected value is written to the preferences. Let's store the corrected value instead. Signed-off-by: Berthold Stoeger --- core/qthelper.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/qthelper.cpp b/core/qthelper.cpp index 564d4394f..85914767c 100644 --- a/core/qthelper.cpp +++ b/core/qthelper.cpp @@ -471,8 +471,6 @@ QString uiLanguage(QLocale *callerLoc) else uiLang = languages[0]; - prefs.locale.lang_locale = copy_qstring(uiLang); - // there's a stupid Qt bug on MacOS where uiLanguages doesn't give us the country info if (!uiLang.contains('-') && uiLang != loc.bcp47Name()) { QLocale loc2(loc.bcp47Name()); @@ -488,6 +486,8 @@ QString uiLanguage(QLocale *callerLoc) if (callerLoc) *callerLoc = loc; + prefs.locale.lang_locale = copy_qstring(uiLang); + if (!prefs.date_format_override || empty_string(prefs.date_format_short) || empty_string(prefs.date_format)) { // derive our standard date format from what the locale gives us // the short format is fine -- cgit v1.2.3-70-g09d2