66 lines
3.2 KiB
Diff
66 lines
3.2 KiB
Diff
From 8c636ea4383595caddcf51fda73c23e3ea5a59ea Mon Sep 17 00:00:00 2001
|
|
From: Boudewijn Rempt <boud@valdyas.org>
|
|
Date: Wed, 9 May 2018 15:14:00 +0200
|
|
Subject: [PATCH 3/3] Patch the location where ki18n looks for catalogs
|
|
|
|
Because GenericDataLocation is wrong for appimages, windows
|
|
and macOS.
|
|
|
|
(cherry-picked from commit 2996aaf9f1bf85ac5d3005294c458a826670d448)
|
|
---
|
|
docs/programmers-guide.md | 2 +-
|
|
src/i18n/kcatalog.cpp | 4 ++--
|
|
src/i18n/klocalizedstring.cpp | 2 +-
|
|
3 files changed, 4 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/docs/programmers-guide.md b/docs/programmers-guide.md
|
|
index 9831b08..61038fb 100644
|
|
--- a/docs/programmers-guide.md
|
|
+++ b/docs/programmers-guide.md
|
|
@@ -2243,7 +2243,7 @@ then a call to
|
|
|
|
~~~
|
|
QString splashPath = QStandardPaths::locate(
|
|
- QStandardPaths::GenericDataLocation, "splash.png");
|
|
+ QStandardPaths::AppDataLocation, "splash.png");
|
|
splashPath = KLocalizedString::localizedFilePath(splashPath);
|
|
~~~
|
|
|
|
diff --git a/src/i18n/kcatalog.cpp b/src/i18n/kcatalog.cpp
|
|
index 3bc605f..1f46e5e 100644
|
|
--- a/src/i18n/kcatalog.cpp
|
|
+++ b/src/i18n/kcatalog.cpp
|
|
@@ -236,7 +236,7 @@ QString KCatalog::catalogLocaleDir(const QByteArray &domain, const QString &lang
|
|
return assetPath;
|
|
|
|
#else
|
|
- QString file = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("locale/") + relpath);
|
|
+ QString file = QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("locale/") + relpath);
|
|
#ifdef Q_OS_WIN
|
|
// QStandardPaths fails on Windows for executables that aren't properly deployed yet, such as unit tests
|
|
if (file.isEmpty()) {
|
|
@@ -259,7 +259,7 @@ QString KCatalog::catalogLocaleDir(const QByteArray &domain, const QString &lang
|
|
QSet<QString> KCatalog::availableCatalogLanguages(const QByteArray &domain_)
|
|
{
|
|
QString domain = QFile::decodeName(domain_);
|
|
- QStringList localeDirPaths = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("locale"), QStandardPaths::LocateDirectory);
|
|
+ QStringList localeDirPaths = QStandardPaths::locateAll(QStandardPaths::AppDataLocation, QStringLiteral("locale"), QStandardPaths::LocateDirectory);
|
|
#ifdef Q_OS_WIN
|
|
// QStandardPaths fails on Windows for executables that aren't properly deployed yet, such as unit tests
|
|
localeDirPaths += QLatin1String(INSTALLED_LOCALE_PREFIX) + QLatin1String("/bin/data/locale/");
|
|
diff --git a/src/i18n/klocalizedstring.cpp b/src/i18n/klocalizedstring.cpp
|
|
index f6e14b8..641895b 100644
|
|
--- a/src/i18n/klocalizedstring.cpp
|
|
+++ b/src/i18n/klocalizedstring.cpp
|
|
@@ -1277,7 +1277,7 @@ void KLocalizedStringPrivate::locateScriptingModule(const QByteArray &domain, co
|
|
QMutexLocker lock(&s->klspMutex);
|
|
|
|
QString modapath =
|
|
- QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("locale/%1/%2/%3/%3.js").arg(language, s->scriptDir, QLatin1String{domain}));
|
|
+ QStandardPaths::locate(QStandardPaths::AppDataLocation, QLatin1String("locale/%1/%2/%3/%3.js").arg(language, s->scriptDir, QLatin1String{domain}));
|
|
|
|
// If the module exists and hasn't been already included.
|
|
if (!modapath.isEmpty() && !s->scriptModules[language].contains(domain)) {
|
|
--
|
|
2.37.1.windows.1
|
|
|