32 lines
1.1 KiB
Diff
32 lines
1.1 KiB
Diff
From e23fa45015f7df6ed2e2f830dfb36aaffee2432a Mon Sep 17 00:00:00 2001
|
|
From: Alvin Wong <alvin@alvinhc.com>
|
|
Date: Tue, 15 Jun 2021 16:43:02 +0000
|
|
Subject: [PATCH 1/3] ki18n: fix loading catalogs with patched gettext
|
|
|
|
---
|
|
src/i18n/kcatalog.cpp | 7 +++++++
|
|
1 file changed, 7 insertions(+)
|
|
|
|
diff --git a/src/i18n/kcatalog.cpp b/src/i18n/kcatalog.cpp
|
|
index 2bd9432..6bd728b 100644
|
|
--- a/src/i18n/kcatalog.cpp
|
|
+++ b/src/i18n/kcatalog.cpp
|
|
@@ -143,8 +143,15 @@ KCatalog::KCatalog(const QByteArray &domain, const QString &language_)
|
|
: d(new KCatalogPrivate)
|
|
{
|
|
d->domain = domain;
|
|
+#if defined(_WIN32) && defined(__WIN32_USE_UTF8)
|
|
+ // Krita uses Microsoft's patched version of gettext to support UTF-8 paths.
|
|
+ // Convert the paths to UTF-8 prior to sending.
|
|
+ d->language = language_.toUtf8();
|
|
+ d->localeDir = catalogLocaleDir(domain, language_).toUtf8();
|
|
+#else
|
|
d->language = QFile::encodeName(language_);
|
|
d->localeDir = QFile::encodeName(catalogLocaleDir(domain, language_));
|
|
+#endif
|
|
|
|
if (!d->localeDir.isEmpty()) {
|
|
// Always get translations in UTF-8, regardless of user's environment.
|
|
--
|
|
2.37.1.windows.1
|
|
|