summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2019-11-20 21:17:28 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-11-20 21:17:39 -0800
commit2fb9367afe02cc2837b7a7c3be20f721d8032be7 (patch)
tree204d439f097c218cccdcaa4c88aa9ef4b5486968
parent03344b0d9e5b6aa562016b0d422e1cd48bf8989a (diff)
downloadsubsurface-2fb9367afe02cc2837b7a7c3be20f721d8032be7.tar.gz
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 <dirk@hohndel.org>
-rw-r--r--core/qt-init.cpp7
1 files changed, 7 insertions, 0 deletions
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);