Files
polkit/polkit-gettext.patch
Marcus Meissner 78b8bd4db1 - Updated to version 126:
+ Highlights:
    - many code fixes detected either by CI or the author himself (Frantisek Sumsal)
    - shellcheck and dependabot integration (Jan Macku)
    - search for rules in /usr/local/share rather than /usr/local/lib (Luca Boccassi)
    - Implement LogControl1 protocol for dynamic log level changes (Luca Boccassi)
    - read actions also from /etc/, /run/ and /usr/local/share/ (Luca Boccassi)
    - mozjs dropped in favor of duktape (Xi Ruoyao)
    - many other fixes in build system and polkit code (Many thanks to all the authors.)
- Updated to version 125:
  + Highlights:
    - introduction of CodeQL and a new integration test suite (Frantisek Sumsal)
    - dropped mocklibc (Frantisek Sumsal)
    - syslog-style log-levels introduction (Jan Rybar)
    - LogControl integration (Luca Boccassi)
    - pkexec: "No session for cookie" finally fixed (huxiaodong)
    - resources optimizations: only instances affected by sessions-change recalculate authorizations (Jan Rybar, thanks to Michal Sekletar and Milan Crha)
    - meson tweaks (Alyssa Ross, Luca Boccassi, Michael Biebl, Michael Olbrich)
    - build warnings cleanup (peelz)
    - Packit service configuration for the new upstream platform (Vincent Mihalkovic)
    - systemd-tmpfiles.d integration (Vincent Mihalkovic)
    - other fixes and changes (Gleb Popov, heather7283, Tianyu Chen, Tobias Stoeckmann)
    - internationalization: Slovenian (filmsi), Hindi (Scrambled777)
- Updated to version 124:
  + Highlights:
    - PIDFDs are used if available to track processes
    - pidfd parameter available for CheckAuthorization()
    - systemd-sysuser enabled for polkit
- polkit-actions-in-etc.patch: done upstream in commit 9958c259f82b066f613d171d2934c1bd829e31a4
- polkit-fix-implicit.patch: not needed anymore

OBS-URL: https://build.opensuse.org/package/show/Base:System/polkit?expand=0&rev=197
2025-09-05 15:12:14 +00:00

55 lines
1.9 KiB
Diff

From fea7159b7cc50deb7298b2858e125fb623012549 Mon Sep 17 00:00:00 2001
From: Ludwig Nussel <ludwig.nussel@suse.de>
Date: Tue, 13 Jun 2017 18:28:28 +0200
Subject: [PATCH] Use gettext as fallback for translations
Upstream polkit action files do not necessarily contain translations for
all languages a distribution supports. And even if all translations are
contained in the head branch, distributions sometimes need to ship older
versions of packages. In order to allow retrofitting translations and
shipping language packs for polkit actions without having to patch and
rebuild packages gettext could be used as fallback. That way only
additional .mo files have to be installed.
So this patch makes polkit call into gettext with the domain
'polkit-action-distro-translations' if an xml doesn't contain
translations for the requested language.
---
src/polkitbackend/polkitbackendactionpool.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
Index: polkit-126/src/polkitbackend/polkitbackendactionpool.c
===================================================================
--- polkit-126.orig/src/polkitbackend/polkitbackendactionpool.c
+++ polkit-126/src/polkitbackend/polkitbackendactionpool.c
@@ -23,6 +23,7 @@
#include <pwd.h>
#include <string.h>
#include <expat.h>
+#include <locale.h>
#ifdef ENABLE_GETTEXT
#include <locale.h>
@@ -1232,8 +1233,20 @@ _localize (GHashTable *translations,
if (result != NULL)
goto out;
- /* fall back to untranslated */
- result = untranslated;
+ /* try distro provided language bundle via gettext */
+
+ /* Set LANG and locale so g_dgettext() + friends work below */
+ if (setlocale (LC_ALL, lang) == NULL)
+ {
+ g_printerr ("Invalid locale '%s'\n", lang);
+ }
+ g_setenv ("LANG", lang, TRUE);
+
+ result = g_dgettext ("polkit-action-distro-translations", untranslated);
+
+ /* Back to C! */
+ setlocale (LC_ALL, "C");
+ g_setenv ("LANG", "C", TRUE);
out:
return result;