mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
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>
This commit is contained in:
parent
03344b0d9e
commit
2fb9367afe
1 changed files with 7 additions and 0 deletions
|
@ -59,9 +59,16 @@ void init_qt_late()
|
||||||
QLocale loc;
|
QLocale loc;
|
||||||
|
|
||||||
// assign en_GB for use in South African locale
|
// 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) {
|
if (loc.country() == QLocale::SouthAfrica) {
|
||||||
loc.setDefault(QLocale("en_GB"));
|
loc.setDefault(QLocale("en_GB"));
|
||||||
loc = QLocale();
|
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);
|
QString uiLang = uiLanguage(&loc);
|
||||||
QLocale::setDefault(loc);
|
QLocale::setDefault(loc);
|
||||||
|
|
Loading…
Reference in a new issue