1a2a7a2ace
OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/extra-cmake-modules?expand=0&rev=175
38 lines
1.9 KiB
Diff
38 lines
1.9 KiB
Diff
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(-)
|
|
|
|
Index: extra-cmake-modules-5.50.0git.20181015T134434~72aa6e1/modules/ECMQmLoader.cpp.in
|
|
===================================================================
|
|
--- extra-cmake-modules-5.50.0git.20181015T134434~72aa6e1.orig/modules/ECMQmLoader.cpp.in
|
|
+++ extra-cmake-modules-5.50.0git.20181015T134434~72aa6e1/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());
|