From d68190a86ac823d64355a33cfd78bd9e8ffd2785 Mon Sep 17 00:00:00 2001 From: Luca Beltrame 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.56.0git.20200226T180944~040504d/modules/ECMQmLoader.cpp.in =================================================================== --- extra-cmake-modules-5.56.0git.20200226T180944~040504d.orig/modules/ECMQmLoader.cpp.in 2020-02-27 07:10:58.979815190 +0100 +++ extra-cmake-modules-5.56.0git.20200226T180944~040504d/modules/ECMQmLoader.cpp.in 2020-02-27 07:13:15.674038108 +0100 @@ -44,15 +44,19 @@ QString subPath = QStringLiteral("locale/") + localeDirName + QStringLiteral("/LC_MESSAGES/@QM_LOADER_CATALOG_NAME@.qm"); #if defined(Q_OS_ANDROID) - const QString fullPath = QStringLiteral("assets:/share/") + subPath; + QString fullPath = QStringLiteral("assets:/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()) { + 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()); if (!translator->load(fullPath)) {