]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
po: add its rules for translating polkit file strings
authorDaniel P. Berrangé <berrange@redhat.com>
Thu, 19 Dec 2024 09:21:51 +0000 (09:21 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Mon, 6 Jan 2025 18:58:31 +0000 (18:58 +0000)
xgettext / msgfmt have generic support for extracting / merging strings
in XML files, however, they need to be told something about the schema
to know which fields are translatable. This is done by providing 'its'
rules. Usually the 'its' rules would be shipped in a -devel package of
the app which owns the schema definition, but polkit does not do this.
Thus libvirt (and other apps) must ship their own local 'its' rules for
polkit.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
po/its/polkit.its [new file with mode: 0644]
po/its/polkit.loc [new file with mode: 0644]
po/meson.build

diff --git a/po/its/polkit.its b/po/its/polkit.its
new file mode 100644 (file)
index 0000000..1c37e6b
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<its:rules xmlns:its="http://www.w3.org/2005/11/its"
+           version="2.0">
+  <its:translateRule selector="//*" translate="no"/>
+  <its:translateRule selector="//action/description |
+                               //action/message"
+                     translate="yes"/>
+</its:rules>
diff --git a/po/its/polkit.loc b/po/its/polkit.loc
new file mode 100644 (file)
index 0000000..c7427ec
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<locatingRules>
+  <locatingRule name="polkit policy" pattern="*.policy">
+    <documentRule localName="policyconfig" target="polkit.its"/>
+  </locatingRule>
+</locatingRules>
index 592b254447969dbf4d26b88bd1b7a1debd14b3c1..126eeabe17b8ef49812557b1309caf41832ebd2f 100644 (file)
@@ -14,6 +14,7 @@ i18n.gettext(
     '--package-version=@0@'.format(meson.project_version()),
     '--sort-output',
   ],
+  data_dirs: meson.current_source_dir()
 )
 
 potfiles_dep = [