Warning, /graphics/krita/3rdparty/ext_frameworks/0003-Patch-the-location-where-ki18n-looks-for-catalogs.patch is written in an unsupported language. File is not indexed.
0001 From 8c636ea4383595caddcf51fda73c23e3ea5a59ea Mon Sep 17 00:00:00 2001 0002 From: Boudewijn Rempt <boud@valdyas.org> 0003 Date: Wed, 9 May 2018 15:14:00 +0200 0004 Subject: [PATCH 3/3] Patch the location where ki18n looks for catalogs 0005 0006 Because GenericDataLocation is wrong for appimages, windows 0007 and macOS. 0008 0009 (cherry-picked from commit 2996aaf9f1bf85ac5d3005294c458a826670d448) 0010 --- 0011 docs/programmers-guide.md | 2 +- 0012 src/i18n/kcatalog.cpp | 4 ++-- 0013 src/i18n/klocalizedstring.cpp | 2 +- 0014 3 files changed, 4 insertions(+), 4 deletions(-) 0015 0016 diff --git a/docs/programmers-guide.md b/docs/programmers-guide.md 0017 index 9831b08..61038fb 100644 0018 --- a/docs/programmers-guide.md 0019 +++ b/docs/programmers-guide.md 0020 @@ -2243,7 +2243,7 @@ then a call to 0021 0022 ~~~ 0023 QString splashPath = QStandardPaths::locate( 0024 - QStandardPaths::GenericDataLocation, "splash.png"); 0025 + QStandardPaths::AppDataLocation, "splash.png"); 0026 splashPath = KLocalizedString::localizedFilePath(splashPath); 0027 ~~~ 0028 0029 diff --git a/src/i18n/kcatalog.cpp b/src/i18n/kcatalog.cpp 0030 index 3bc605f..1f46e5e 100644 0031 --- a/src/i18n/kcatalog.cpp 0032 +++ b/src/i18n/kcatalog.cpp 0033 @@ -236,7 +236,7 @@ QString KCatalog::catalogLocaleDir(const QByteArray &domain, const QString &lang 0034 return assetPath; 0035 0036 #else 0037 - QString file = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("locale/") + relpath); 0038 + QString file = QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("locale/") + relpath); 0039 #ifdef Q_OS_WIN 0040 // QStandardPaths fails on Windows for executables that aren't properly deployed yet, such as unit tests 0041 if (file.isEmpty()) { 0042 @@ -259,7 +259,7 @@ QString KCatalog::catalogLocaleDir(const QByteArray &domain, const QString &lang 0043 QSet<QString> KCatalog::availableCatalogLanguages(const QByteArray &domain_) 0044 { 0045 QString domain = QFile::decodeName(domain_); 0046 - QStringList localeDirPaths = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("locale"), QStandardPaths::LocateDirectory); 0047 + QStringList localeDirPaths = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, QStringLiteral("locale"), QStandardPaths::LocateDirectory); 0048 #ifdef Q_OS_WIN 0049 // QStandardPaths fails on Windows for executables that aren't properly deployed yet, such as unit tests 0050 localeDirPaths += QLatin1String(INSTALLED_LOCALE_PREFIX) + QLatin1String("/bin/data/locale/"); 0051 diff --git a/src/i18n/klocalizedstring.cpp b/src/i18n/klocalizedstring.cpp 0052 index f6e14b8..641895b 100644 0053 --- a/src/i18n/klocalizedstring.cpp 0054 +++ b/src/i18n/klocalizedstring.cpp 0055 @@ -1277,7 +1277,7 @@ void KLocalizedStringPrivate::locateScriptingModule(const QByteArray &domain, co 0056 QMutexLocker lock(&s->klspMutex); 0057 0058 QString modapath = 0059 - QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("locale/%1/%2/%3/%3.js").arg(language, s->scriptDir, QLatin1String{domain})); 0060 + QStandardPaths::locate(QStandardPaths::AppDataLocation, QLatin1String("locale/%1/%2/%3/%3.js").arg(language, s->scriptDir, QLatin1String{domain})); 0061 0062 // If the module exists and hasn't been already included. 0063 if (!modapath.isEmpty() && !s->scriptModules[language].contains(domain)) { 0064 -- 0065 2.37.1.windows.1 0066