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
This commit is contained in:
Aleksander Morgado
2017-09-07 13:04:34 +02:00
parent f0bb6ef856
commit 984625165e
13 changed files with 196 additions and 88 deletions
+21 -11
View File
@@ -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
if WITH_POLKIT
polkit_policydir = $(datadir)/polkit-1/actions
polkit_policy_DATA = $(polkit_policy_in_in_files:.policy.in.in=.policy)
@INTLTOOL_POLICY_RULE@
endif
# 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 = 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)
+8
View File
@@ -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>
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0"?>
<locatingRules>
<locatingRule name="polkit policy" pattern="*.policy">
<documentRule localName="policyconfig" target="polkit.its"/>
</locatingRule>
</locatingRules>
+16 -16
View File
@@ -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>