From 2fb9367afe02cc2837b7a7c3be20f721d8032be7 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 20 Nov 2019 21:17:28 -0800 Subject: Translations: try to be smarter when picking the right locale I was reminded to do this when a user in French speaking Switzerland reasonably suggested that fr_FR would be a much better fallback than en_US in their situation. Fixes: #2388 Signed-off-by: Dirk Hohndel --- core/qt-init.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'core') diff --git a/core/qt-init.cpp b/core/qt-init.cpp index ead7f4654..105742b82 100644 --- a/core/qt-init.cpp +++ b/core/qt-init.cpp @@ -59,9 +59,16 @@ void init_qt_late() QLocale loc; // assign en_GB for use in South African locale + // and capture other French and Spanish speaking countries with the corresponding canonical locales if (loc.country() == QLocale::SouthAfrica) { loc.setDefault(QLocale("en_GB")); loc = QLocale(); + } else if (loc.language() == QLocale::French) { + loc.setDefault(QLocale("fr_FR")); + loc = QLocale(); + } else if (loc.language() == QLocale::Spanish) { + loc.setDefault(QLocale("es_ES")); + loc = QLocale(); } QString uiLang = uiLanguage(&loc); QLocale::setDefault(loc); -- cgit v1.2.3-70-g09d2