extra-cmake-modules/bundle-lang.patch

35 lines
1.4 KiB
Diff
Raw Normal View History

From 8c4c416228acf30862792b4a0da24d865988ea0f Mon Sep 17 00:00:00 2001
From: Wolfgang Bauer <wbauer@tmo.at>
Date: Thu, 13 Jul 2017 16:53:08 +0200
Subject: [PATCH] Also search in /usr/share/locale-bundle/ for translations
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 | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/modules/ECMQmLoader.cpp.in b/modules/ECMQmLoader.cpp.in
index 12a2d14..81fb6fb 100644
--- a/modules/ECMQmLoader.cpp.in
+++ b/modules/ECMQmLoader.cpp.in
@@ -43,7 +43,11 @@ namespace {
QString subPath = QStringLiteral("locale/") + localeDirName + QStringLiteral("/LC_MESSAGES/@QM_LOADER_CATALOG_NAME@.qm");
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;
+ }
}
QTranslator *translator = new QTranslator(QCoreApplication::instance());
if (!translator->load(fullPath)) {
--
2.12.3