diff options
author | Aleix Pol <aleixpol@kde.org> | 2018-09-24 12:57:15 +0200 |
---|---|---|
committer | Aleix Pol <aleixpol@kde.org> | 2018-09-24 12:57:26 +0200 |
commit | 0d961ecbdf176fd4fe91c19b5479195e87ec5899 (patch) | |
tree | 1a63860fad8a0c5d7effa82873130720a24b062c | |
parent | 20e619af331f0a7e7632a351eb67c62e0209910a (diff) | |
download | extra-cmake-modules-0d961ecbdf176fd4fe91c19b5479195e87ec5899.tar.gz extra-cmake-modules-0d961ecbdf176fd4fe91c19b5479195e87ec5899.tar.bz2 |
Android: Make sure Qm translations get loaded
Summary: Use a similar strategy as D14528 to find qm files.
Test Plan: Analitza parts of KAlgebra are translated too.
Reviewers: #frameworks, aacid
Reviewed By: aacid
Subscribers: svuorela, aacid, kde-frameworks-devel, kde-buildsystem
Tags: #frameworks, #build_system
Differential Revision: https://phabricator.kde.org/D14529
-rw-r--r-- | modules/ECMQmLoader.cpp.in | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/modules/ECMQmLoader.cpp.in b/modules/ECMQmLoader.cpp.in index f636ecc4..003512d1 100644 --- a/modules/ECMQmLoader.cpp.in +++ b/modules/ECMQmLoader.cpp.in @@ -35,16 +35,25 @@ #include <QStandardPaths> #include <QThread> #include <QTranslator> +#include <QDir> namespace { bool loadTranslation(const QString &localeDirName) { QString subPath = QStringLiteral("locale/") + localeDirName + QStringLiteral("/LC_MESSAGES/@QM_LOADER_CATALOG_NAME@.qm"); - QString fullPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, subPath); + +#if defined(Q_OS_ANDROID) + const QString fullPath = QDir::homePath()+QStringLiteral("/../qt-reserved-files/share/") + subPath; + if (!QFile::exists(fullPath)) { + return false; + } +#else + const QString fullPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, subPath); if (fullPath.isEmpty()) { return false; } +#endif QTranslator *translator = new QTranslator(QCoreApplication::instance()); if (!translator->load(fullPath)) { delete translator; |