diff --git a/shell/scripting/appinterface.cpp b/shell/scripting/appinterface.cpp index 2c54f1e40..04ca07185 100644 --- a/shell/scripting/appinterface.cpp +++ b/shell/scripting/appinterface.cpp @@ -130,6 +130,11 @@ QString AppInterface::language() const return QLocale::system().languageToString(QLocale::system().language()); } +QString AppInterface::languageId() const +{ + return QLocale::system().bcp47Name().section('-', 0, 0); +} + bool AppInterface::multihead() const { #ifdef Q_OS_WIN diff --git a/shell/scripting/appinterface.h b/shell/scripting/appinterface.h index 93aa0143a..f4a75f94f 100644 --- a/shell/scripting/appinterface.h +++ b/shell/scripting/appinterface.h @@ -55,6 +55,7 @@ class AppInterface : public QObject Q_PROPERTY(bool multiheadScreen READ multihead) Q_PROPERTY(QString locale READ locale) Q_PROPERTY(QString language READ language) + Q_PROPERTY(QString languageId READ languageId) public: AppInterface(ScriptEngine *env); @@ -78,6 +79,7 @@ public: QString locale() const; QString language() const; + QString languageId() const; bool multihead() const; int multiheadScreen() const;