Accepting request 510131 from home:wolfi323:test

- Add bundle-lang patch to find .qm translations in  /usr/share/locale-bundle/ (boo#1027925, boo#1048030)

OBS-URL: https://build.opensuse.org/request/show/510131
OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/extra-cmake-modules?expand=0&rev=137
This commit is contained in:
Luca Beltrame 2017-07-13 19:59:10 +00:00 committed by Git OBS Bridge
parent 968b4045bf
commit 3574e147fb
3 changed files with 43 additions and 0 deletions

34
bundle-lang.patch Normal file
View File

@ -0,0 +1,34 @@
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

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Jul 13 14:22:07 UTC 2017 - wbauer@tmo.at
- Add bundle-lang patch to find .qm translations in
/usr/share/locale-bundle/ (boo#1027925, boo#1048030)
-------------------------------------------------------------------
Wed Jul 12 07:13:58 CEST 2017 - lbeltrame@kde.org

View File

@ -25,6 +25,8 @@ Url: https://projects.kde.org/projects/kdesupport/extra-cmake-modules
Version: 5.36.0
Release: 0
Source: http://download.kde.org/stable/frameworks/%{_tar_path}/%{name}-%{version}.tar.xz
# PATCH-FIX-OPENSUSE
Patch0: bundle-lang.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: cmake >= 3.0
BuildRequires: gcc-c++
@ -58,6 +60,7 @@ This package provides documentation for extra-cmake-modules
%prep
%setup -q
%patch0 -p1
%build
%cmake_kf5 -d build