Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Backports:SLE-15:Update
ki18n
fallbackLang.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File fallbackLang.diff of Package ki18n
Index: ki18n-5.36.0git.20170711T131800~4c95ac8/src/kcatalog.cpp =================================================================== --- ki18n-5.36.0git.20170711T131800~4c95ac8.orig/src/kcatalog.cpp +++ ki18n-5.36.0git.20170711T131800~4c95ac8/src/kcatalog.cpp @@ -117,9 +117,22 @@ KCatalog::~KCatalog() QString KCatalog::catalogLocaleDir(const QByteArray &domain, const QString &language) { - QString relpath = QStringLiteral("%1/LC_MESSAGES/%2.mo") + QStringList localeDirs; + QString localeDir; + 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); @@ -130,22 +143,36 @@ QString KCatalog::catalogLocaleDir(const QString file = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("locale/") + relpath); - QString localeDir; - if (file.isEmpty()) { - localeDir = QString(); - } else { + if (!file.isEmpty()) { // Path of the locale/ directory must be returned. localeDir = QFileInfo(file.left(file.size() - relpath.size())).absolutePath(); + return localeDir; } + // No translation around + localeDir = QString(); return localeDir; } 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