Expose BCP47 language id for system locale as property in the shell scripting interface.

wilder-5.14
Eike Hein 10 years ago
parent 6885d1f4d5
commit e452cd3ea8
  1. 5
      shell/scripting/appinterface.cpp
  2. 2
      shell/scripting/appinterface.h

@ -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

@ -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;

Loading…
Cancel
Save