extra-cmake-modules/bundle-lang.patch

40 lines
1.8 KiB
Diff
Raw Normal View History

From d68190a86ac823d64355a33cfd78bd9e8ffd2785 Mon Sep 17 00:00:00 2001
From: Luca Beltrame <lbeltrame@kde.org>
Date: Wed, 26 Sep 2018 22:50:24 +0200
Subject: [PATCH] openSUSE's bundle-lang packages install the translations in
/usr/share/locale-bundle/ to not conflict with the standard -lang packages.
So look there too if a translation was not found in /usr/share/locale/.
---
modules/ECMQmLoader.cpp.in | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/modules/ECMQmLoader.cpp.in b/modules/ECMQmLoader.cpp.in
index 003512d..bc6a4ad 100644
--- a/modules/ECMQmLoader.cpp.in
+++ b/modules/ECMQmLoader.cpp.in
@@ -44,14 +44,18 @@ namespace {
QString subPath = QStringLiteral("locale/") + localeDirName + QStringLiteral("/LC_MESSAGES/@QM_LOADER_CATALOG_NAME@.qm");
#if defined(Q_OS_ANDROID)
- const QString fullPath = QDir::homePath()+QStringLiteral("/../qt-reserved-files/share/") + subPath;
+ 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);
+ QString fullPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, subPath);
if (fullPath.isEmpty()) {
- return false;
+ subPath = QStringLiteral("locale-bundle/") + localeDirName + QStringLiteral("/LC_MESSAGES/@QM_LOADER_CATALOG_NAME@.qm");
+ fullPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, subPath);
+ if (fullPath.isEmpty()) {
+ return false;
+ }
}
#endif
QTranslator *translator = new QTranslator(QCoreApplication::instance());
--
2.19.0