Get language name and country name from QLocale (Linux)

This commit is contained in:
Vitaly Lipatov 2019-06-12 10:16:36 +03:00 committed by John Preston
parent 0c3773486e
commit 9276101809

View File

@ -7,6 +7,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/ */
#include "platform/linux/info_linux.h" #include "platform/linux/info_linux.h"
#include <QLocale>
namespace Platform { namespace Platform {
QString DeviceModelPretty() { QString DeviceModelPretty() {
@ -25,11 +27,13 @@ QString SystemVersionPretty() {
} }
QString SystemCountry() { QString SystemCountry() {
return QString(); QLocale locale;
return locale.name().split('_').last();
} }
QString SystemLanguage() { QString SystemLanguage() {
return QString(); QLocale locale;
return locale.name().split('_').first();
} }
QDate WhenSystemBecomesOutdated() { QDate WhenSystemBecomesOutdated() {