aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/translation/translation.cpp10
-rw-r--r--plugins/translation/translation.h4
-rw-r--r--sysui/display/FunctionsPage.qml4
3 files changed, 14 insertions, 4 deletions
diff --git a/plugins/translation/translation.cpp b/plugins/translation/translation.cpp
index 2b79fd4..47e3074 100644
--- a/plugins/translation/translation.cpp
+++ b/plugins/translation/translation.cpp
@@ -62,6 +62,11 @@ QString Translation::languageLocale() const
return m_languageLocale;
}
+QString Translation::emptyString() const
+{
+ return "";
+}
+
bool Translation::loadTranslationFile(const QString &langLocale)
{
QString fileToLoad(m_languageFilePath);
@@ -70,8 +75,9 @@ bool Translation::loadTranslationFile(const QString &langLocale)
if ( m_translator.load(fileToLoad) ) {
qApp->installTranslator(&m_translator);
- QEvent ev(QEvent::LanguageChange);
- qApp->sendEvent(QQmlEngine::contextForObject(this)->engine(), &ev);
+// NOTE: This only works with 5.10
+// QEvent ev(QEvent::LanguageChange);
+// qApp->sendEvent(QQmlEngine::contextForObject(this)->engine(), &ev);
return true;
}
diff --git a/plugins/translation/translation.h b/plugins/translation/translation.h
index c2e411b..2648f74 100644
--- a/plugins/translation/translation.h
+++ b/plugins/translation/translation.h
@@ -41,6 +41,7 @@ class Translation : public QObject
Q_OBJECT
Q_PROPERTY(QString languageLocale READ languageLocale WRITE setLanguageLocale NOTIFY languageLocaleChanged)
+ Q_PROPERTY(QString emptyString READ emptyString NOTIFY languageChanged)
public:
explicit Translation(QObject *parent = nullptr);
@@ -50,6 +51,9 @@ public:
void setLanguageLocale(const QString &languageLocale);
QString languageLocale() const;
+ // Helper method to notify string change
+ QString emptyString() const;
+
signals:
void languageLocaleChanged();
void languageChanged();
diff --git a/sysui/display/FunctionsPage.qml b/sysui/display/FunctionsPage.qml
index eff2438..edc6e72 100644
--- a/sysui/display/FunctionsPage.qml
+++ b/sysui/display/FunctionsPage.qml
@@ -97,7 +97,7 @@ UIPage {
delegate: FunctionButton {
width: GridView.view.cellWidth
height: GridView.view.cellHeight
- text: qsTrId(model.description)
+ text: qsTrId(model.description) + Style.translation.emptyString
icon: Style.symbolM(model.icon, model.active)
highlighted: model.active
@@ -105,7 +105,7 @@ UIPage {
popupInterface.functionIcon = icon
popupInterface.currentState = model.active
popupInterface.functionIndex = index
- popupInterface.functionName = qsTrId(model.description)
+ popupInterface.functionName = qsTrId(model.description) + Style.translation.emptyString
popupInterface.summary = !model.active ? "Activate " + popupInterface.functionName + " ?" : "Deactivate " + popupInterface.functionName + " ?"
popupInterface.show()
}