diff options
author | Scott Murray <scott.murray@konsulko.com> | 2022-01-31 16:00:02 -0500 |
---|---|---|
committer | Scott Murray <scott.murray@konsulko.com> | 2022-01-31 16:03:58 -0500 |
commit | 3fc84a0a674fa532f6aded100cf2beb3d0cf1f83 (patch) | |
tree | 0f1c150ff82585dff574cf912fb673dfcb0360aa /app | |
parent | ea6826a71f6cf86b350f81af2409fed1e318cf1e (diff) |
Fix translation file installionmarlin_12.93.0marlin_12.92.0marlin/12.93.0marlin/12.92.012.93.012.92.0
The rework for app framework removal broke the installation of the
translation files that was being done in the qmake file related to
widget assembly. An install target to replace that has been added,
and the location of the translation files shifted to under the
/usr/share hierarchy to better match Linux FHS expectations.
Bug-AGL: SPEC-4230
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Change-Id: I9d7352c8ee79fdb11d3d432608d29cac3e5a4060
Diffstat (limited to 'app')
-rw-r--r-- | app/translations.pri | 8 | ||||
-rw-r--r-- | app/translator.cpp | 3 |
2 files changed, 8 insertions, 3 deletions
diff --git a/app/translations.pri b/app/translations.pri index 81bd94b..9433f0e 100644 --- a/app/translations.pri +++ b/app/translations.pri @@ -8,9 +8,15 @@ TRANSLATIONS = $$prependAll(LANGUAGES, $$PWD/translations/$${TARGET}_,.ts) qm.depends = $${TRANSLATIONS} qm.input = TRANSLATIONS -qm.output = $$OUT_PWD/../package/root/translations/${QMAKE_FILE_BASE}.qm +qm.output = $$OUT_PWD/translations/${QMAKE_FILE_BASE}.qm qm.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_OUT} qm.name = LRELEASE ${QMAKE_FILE_IN} qm.CONFIG += no_link QMAKE_EXTRA_COMPILERS += qm PRE_TARGETDEPS += compiler_qm_make_all + +target_translations.path = /usr/share/$${TARGET} +target_translations.files += $$prependAll(LANGUAGES, $${OUT_PWD}/translations/$${TARGET}_,.qm) +target_translations.CONFIG = no_check_exist + +INSTALLS += target_translations diff --git a/app/translator.cpp b/app/translator.cpp index 9b67f13..fcc274c 100644 --- a/app/translator.cpp +++ b/app/translator.cpp @@ -41,8 +41,7 @@ void Translator::setTranslator(const QString &language) } QLocale locale(language); QString fileName = QCoreApplication::instance()->applicationName().toLower(); - qDebug() << "####" << QDir::currentPath() << QCoreApplication::applicationDirPath(); - if (m_translator->load(locale, fileName, QStringLiteral("_"), QStringLiteral("%1/../translations").arg(QCoreApplication::applicationDirPath()))) { + if (m_translator->load(locale, fileName, QStringLiteral("_"), QStringLiteral("/usr/share/%1").arg(fileName))) { QCoreApplication::installTranslator(m_translator); } else { delete m_translator; |