2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Use QLocale::uiLanguages for system language.

This commit is contained in:
John Preston
2019-08-09 11:06:27 +01:00
parent 9276101809
commit e9ab8df737
4 changed files with 13 additions and 15 deletions

View File

@@ -27,13 +27,15 @@ QString SystemVersionPretty() {
}
QString SystemCountry() {
QLocale locale;
return locale.name().split('_').last();
return QLocale::system().name().split('_').last();
}
QString SystemLanguage() {
QLocale locale;
return locale.name().split('_').first();
const auto system = QLocale::system();
const auto languages = system.uiLanguages();
return languages.isEmpty()
? system.name().split('_').first()
: languages.front();
}
QDate WhenSystemBecomesOutdated() {