mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-25 07:19:42 -05:00
Display country in language list.
But only if the translation specifies one.
This commit is contained in:
parent
6327eaf587
commit
607007f94f
@ -67,8 +67,15 @@ QList<QPair<QString, QString> > Translator::availableLanguages()
|
||||
langcode = "en";
|
||||
}
|
||||
|
||||
languages.append(QPair<QString, QString>(langcode,
|
||||
QLocale::languageToString(QLocale(langcode).language())));
|
||||
QLocale locale(langcode);
|
||||
QString languageStr = QLocale::languageToString(locale.language());
|
||||
QString countryStr;
|
||||
if (langcode.contains("_")) {
|
||||
countryStr = QString(" (%1)").arg(QLocale::countryToString(locale.country()));
|
||||
}
|
||||
|
||||
QPair<QString, QString> language(langcode, languageStr + countryStr);
|
||||
languages.append(language);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user