Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.1:Staging:E
ki18n
fallbackLang.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File fallbackLang.diff of Package ki18n
diff --git a/src/kcatalog.cpp b/src/kcatalog.cpp index 8b8feb3..1ccc28b 100644 --- a/src/kcatalog.cpp +++ b/src/kcatalog.cpp @@ -118,9 +118,21 @@ KCatalog::~KCatalog() QString KCatalog::catalogLocaleDir(const QByteArray &domain, const QString &language) { - QString relpath = QStringLiteral("%1/LC_MESSAGES/%2.mo") + QStringList localeDirs; + QString relpath = QStringLiteral("%1/LC_MESSAGES/%2.mo") .arg(language, QFile::decodeName(domain)); + // Specific SUSE kf5 location ; bundle-lang-bla ; update-translations ; generic + localeDirs << QStringLiteral("/usr/share/locale/kf5/") << QStringLiteral("/usr/share/locale-bundle/kf5/") << QStringLiteral("/usr/share/locale-bundle/") << QStringLiteral("/usr/share/locale-langpack/"); + + foreach (const QString &locDir, localeDirs) { + QFile file(locDir + relpath); + if (file.exists()) { + return locDir; + } + } + // Check the standard locations + { QMutexLocker lock(&catalogStaticData->mutex); const QString customLocaleDir = catalogStaticData->customCatalogDirs.value(domain); @@ -153,9 +165,23 @@ QString KCatalog::catalogLocaleDir(const QByteArray &domain, QSet<QString> KCatalog::availableCatalogLanguages(const QByteArray &domain_) { QString domain = QFile::decodeName(domain_); - QStringList localeDirPaths = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, - QStringLiteral("locale"), - QStandardPaths::LocateDirectory); + + QStringList localeDirPaths; + QStringList localeDirs; + + // Specific SUSE kf5 location ; bundle-lang-bla ; update-translations ; generic + localeDirs << QStringLiteral("/usr/share/locale/kf5") << QStringLiteral("/usr/share/locale-bundle/kf5") << QStringLiteral("/usr/share/locale-bundle") << QStringLiteral("/usr/share/locale-langpack"); + + foreach (const QString &localeDir, localeDirs) { + QDir locDir(localeDir); + if (locDir.exists()) { + localeDirPaths.append(localeDir); + } + } + QStringList localeFallbackDirPaths = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, + QStringLiteral("locale"), + QStandardPaths::LocateDirectory); + localeDirPaths.append(localeFallbackDirPaths); { QMutexLocker lock(&catalogStaticData->mutex);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor