diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2017-08-25 21:35:18 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2017-09-07 13:04:34 +0200 |
commit | 984625165e09f02b4d6b8389092d5055fdbb0f03 (patch) | |
tree | 6adecbb0c5fa89962d2f31b2c78ac5e2d2448177 /data | |
parent | f0bb6ef8564aabc51e5bd14b6486bc86068364fb (diff) |
i18n: deprecate intltool and use only gettext 0.19.8
Instead of mixing both intltool and gettext, which not always work
correctly together, this patch obsoletes intltool and uses only
gettext, which includes support for translating XML files with ITS
rules.
See migration steps for GNOME projects here:
https://wiki.gnome.org/MigratingFromIntltoolToGettext
The gettext ITS rules for polkit policy files are imported from the
upstream polkit repository. We don't use the polkit-installed rule
files yet because there is no tagged release that contains those files
yet, so we cannot build-depend on any specific polkit version.
https://bugs.freedesktop.org/show_bug.cgi?id=96940
Diffstat (limited to 'data')
-rw-r--r-- | data/Makefile.am | 28 | ||||
-rw-r--r-- | data/its/polkit.its | 8 | ||||
-rw-r--r-- | data/its/polkit.loc | 6 | ||||
-rw-r--r-- | data/org.freedesktop.ModemManager1.policy.in.in | 32 |
4 files changed, 49 insertions, 25 deletions
diff --git a/data/Makefile.am b/data/Makefile.am index 168895d9..ee05bdf6 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -59,15 +59,22 @@ diagrams = \ ModemManager-interface-initialization-sequence.png \ ModemManager-interface-initialization-sequence-subclassed.png - # Polkit -polkit_policy_in_in_files = org.freedesktop.ModemManager1.policy.in.in + +# build file with translations, which we will include in dist +org.freedesktop.ModemManager1.policy.in: org.freedesktop.ModemManager1.policy.in.in + $(AM_V_GEN) GETTEXTDATADIR=$(top_srcdir)/data $(MSGFMT) --xml -d $(top_srcdir)/po/ -o $@ --template $< + if WITH_POLKIT + +# build with requested user policy +org.freedesktop.ModemManager1.policy: org.freedesktop.ModemManager1.policy.in + $(AM_V_GEN) sed -e s,@MM_DEFAULT_USER_POLICY\@,$(MM_DEFAULT_USER_POLICY), $< > $@.tmp && mv $@.tmp $@ + polkit_policydir = $(datadir)/polkit-1/actions -polkit_policy_DATA = $(polkit_policy_in_in_files:.policy.in.in=.policy) -@INTLTOOL_POLICY_RULE@ -endif +polkit_policy_DATA = org.freedesktop.ModemManager1.policy +endif # Set up pkg-config .pc files for exported libraries pkgconfigdir = $(libdir)/pkgconfig @@ -75,23 +82,26 @@ pkgconfig_DATA = \ ModemManager.pc \ mm-glib.pc +MAINTAINERCLEANFILES = \ + org.freedesktop.ModemManager1.policy.in DISTCLEANFILES = \ + org.freedesktop.ModemManager1.policy \ $(dbusactivation_DATA) \ - $(dbusservice_DATA) \ - $(polkit_policy_DATA) + $(dbusservice_DATA) if HAVE_SYSTEMD DISTCLEANFILES += $(systemdsystemunit_DATA) endif - EXTRA_DIST = \ + its \ + org.freedesktop.ModemManager1.policy.in.in \ + org.freedesktop.ModemManager1.policy.in \ $(systemdsystemunit_in_files) \ $(dbusactivation_in_files) \ $(dbusservice_file_polkit) \ $(dbusservice_file_nopolkit) \ $(icon_DATA) \ - $(polkit_policy_in_in_files) \ $(logos) \ $(diagrams) diff --git a/data/its/polkit.its b/data/its/polkit.its new file mode 100644 index 00000000..1c37e6be --- /dev/null +++ b/data/its/polkit.its @@ -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/data/its/polkit.loc b/data/its/polkit.loc new file mode 100644 index 00000000..c7427ec6 --- /dev/null +++ b/data/its/polkit.loc @@ -0,0 +1,6 @@ +<?xml version="1.0"?> +<locatingRules> + <locatingRule name="polkit policy" pattern="*.policy"> + <documentRule localName="policyconfig" target="polkit.its"/> + </locatingRule> +</locatingRules> diff --git a/data/org.freedesktop.ModemManager1.policy.in.in b/data/org.freedesktop.ModemManager1.policy.in.in index bb60192b..7edb20c7 100644 --- a/data/org.freedesktop.ModemManager1.policy.in.in +++ b/data/org.freedesktop.ModemManager1.policy.in.in @@ -10,8 +10,8 @@ <icon_name>ModemManager</icon_name> <action id="org.freedesktop.ModemManager1.Control"> - <_description>Control the Modem Manager daemon</_description> - <_message>System policy prevents controlling the Modem Manager.</_message> + <description>Control the Modem Manager daemon</description> + <message>System policy prevents controlling the Modem Manager.</message> <defaults> <allow_inactive>no</allow_inactive> <allow_active>auth_admin</allow_active> @@ -19,8 +19,8 @@ </action> <action id="org.freedesktop.ModemManager1.Device.Control"> - <_description>Unlock and control a mobile broadband device</_description> - <_message>System policy prevents unlocking or controlling the mobile broadband device.</_message> + <description>Unlock and control a mobile broadband device</description> + <message>System policy prevents unlocking or controlling the mobile broadband device.</message> <defaults> <allow_inactive>no</allow_inactive> <allow_active>@MM_DEFAULT_USER_POLICY@</allow_active> @@ -28,8 +28,8 @@ </action> <action id="org.freedesktop.ModemManager1.Contacts"> - <_description>Add, modify, and delete mobile broadband contacts</_description> - <_message>System policy prevents adding, modifying, or deleting this device's contacts.</_message> + <description>Add, modify, and delete mobile broadband contacts</description> + <message>System policy prevents adding, modifying, or deleting this device's contacts.</message> <defaults> <allow_inactive>no</allow_inactive> <allow_active>@MM_DEFAULT_USER_POLICY@</allow_active> @@ -37,8 +37,8 @@ </action> <action id="org.freedesktop.ModemManager1.Messaging"> - <_description>Send, save, modify, and delete text messages</_description> - <_message>System policy prevents sending or manipulating this device's text messages.</_message> + <description>Send, save, modify, and delete text messages</description> + <message>System policy prevents sending or manipulating this device's text messages.</message> <defaults> <allow_inactive>no</allow_inactive> <allow_active>@MM_DEFAULT_USER_POLICY@</allow_active> @@ -46,8 +46,8 @@ </action> <action id="org.freedesktop.ModemManager1.Voice"> - <_description>Accept incoming voice calls or start outgoing voice calls.</_description> - <_message>System policy prevents voice calls.</_message> + <description>Accept incoming voice calls or start outgoing voice calls.</description> + <message>System policy prevents voice calls.</message> <defaults> <allow_inactive>no</allow_inactive> <allow_active>@MM_DEFAULT_USER_POLICY@</allow_active> @@ -55,8 +55,8 @@ </action> <action id="org.freedesktop.ModemManager1.Location"> - <_description>Enable and view geographic location and positioning information</_description> - <_message>System policy prevents enabling or viewing geographic location information.</_message> + <description>Enable and view geographic location and positioning information</description> + <message>System policy prevents enabling or viewing geographic location information.</message> <defaults> <allow_inactive>no</allow_inactive> <allow_active>@MM_DEFAULT_USER_POLICY@</allow_active> @@ -64,8 +64,8 @@ </action> <action id="org.freedesktop.ModemManager1.USSD"> - <_description>Query and utilize network information and services</_description> - <_message>System policy prevents querying or utilizing network information and services.</_message> + <description>Query and utilize network information and services</description> + <message>System policy prevents querying or utilizing network information and services.</message> <defaults> <allow_inactive>no</allow_inactive> <allow_active>yes</allow_active> @@ -73,8 +73,8 @@ </action> <action id="org.freedesktop.ModemManager1.Firmware"> - <_description>Query and manage firmware on a mobile broadband device</_description> - <_message>System policy prevents querying or managing this device's firmware.</_message> + <description>Query and manage firmware on a mobile broadband device</description> + <message>System policy prevents querying or managing this device's firmware.</message> <defaults> <allow_inactive>no</allow_inactive> <allow_active>auth_admin</allow_active> |