Compare commits
No commits in common. "ba924936fd28d2a475bdc1abbcab6fcd8c90d402" and "0b27fc17715d8d74c00bc4d8e0df0fea36705eac" have entirely different histories.
ba924936fd
...
0b27fc1771
6
debian/changelog
vendored
6
debian/changelog
vendored
@ -1,9 +1,3 @@
|
|||||||
libqtxdg (3.10.0-0ubuntu6) lunar; urgency=medium
|
|
||||||
|
|
||||||
* Add support for translations defined via X-Ubuntu-Gettext-Domain.
|
|
||||||
|
|
||||||
-- Simon Quigley <tsimonq2@ubuntu.com> Mon, 06 Mar 2023 19:18:26 -0600
|
|
||||||
|
|
||||||
libqtxdg (3.10.0-0ubuntu5) lunar; urgency=medium
|
libqtxdg (3.10.0-0ubuntu5) lunar; urgency=medium
|
||||||
|
|
||||||
* Rebuild against lxqt-build-tools 0.12.0-0ubuntu3.
|
* Rebuild against lxqt-build-tools 0.12.0-0ubuntu3.
|
||||||
|
39
debian/patches/ubuntu-gettext-translations.patch
vendored
39
debian/patches/ubuntu-gettext-translations.patch
vendored
@ -1,39 +0,0 @@
|
|||||||
Description: Add support for translations defined via X-Ubuntu-Gettext-Domain
|
|
||||||
Author: Simon Quigley <tsimonq2@lubuntu.me>
|
|
||||||
Origin: vendor
|
|
||||||
Forwarded: https://github.com/lxqt/libqtxdg/pull/292
|
|
||||||
Last-Update: 2023-03-06
|
|
||||||
---
|
|
||||||
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
|
|
||||||
--- a/src/qtxdg/xdgdesktopfile.cpp
|
|
||||||
+++ b/src/qtxdg/xdgdesktopfile.cpp
|
|
||||||
@@ -38,6 +38,7 @@
|
|
||||||
|
|
||||||
#include <cstdlib>
|
|
||||||
#include <unistd.h>
|
|
||||||
+#include <libintl.h>
|
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QDBusInterface>
|
|
||||||
@@ -921,7 +922,22 @@ QString XdgDesktopFile::localizedKey(con
|
|
||||||
|
|
||||||
QVariant XdgDesktopFile::localizedValue(const QString& key, const QVariant& defaultValue) const
|
|
||||||
{
|
|
||||||
- return value(localizedKey(key), defaultValue);
|
|
||||||
+ // If the file is translated via gettext, override locally-defined translations
|
|
||||||
+ if (contains(QLatin1String("X-Ubuntu-Gettext-Domain")))
|
|
||||||
+ {
|
|
||||||
+ QString domain = value(QLatin1String("X-Ubuntu-Gettext-Domain")).toString();
|
|
||||||
+ QString val = value(key, defaultValue).toString().trimmed();
|
|
||||||
+ if (!val.isEmpty()) {
|
|
||||||
+ QByteArray _domain = domain.toUtf8();
|
|
||||||
+ QByteArray _val = val.toUtf8();
|
|
||||||
+ char *translated = dgettext(_domain.constData(), _val.constData());
|
|
||||||
+ return QVariant(QString::fromUtf8(translated));
|
|
||||||
+ } else {
|
|
||||||
+ return QVariant();
|
|
||||||
+ }
|
|
||||||
+ } else {
|
|
||||||
+ return value(localizedKey(key), defaultValue);
|
|
||||||
+ }
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user