[network-manager-applet/wip/inigomartinez/meson: 3/3] build: Migrate from Intltool to Gettext



commit c08ec1719d652928b61e901822e92adb463586e6
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Mon Sep 25 18:58:44 2017 +0200

    build: Migrate from Intltool to Gettext
    
    Recent versions of Gettext are able to translate several formats
    that are used in GNOME applications. This patch migrates from
    Intltool to Gettext by using meson's i18n features.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=788147

 meson.build                         |   19 +++----
 nm-applet.desktop.in                |    4 +-
 nm-connection-editor.appdata.xml.in |   14 +++---
 nm-connection-editor.desktop.in     |    4 +-
 po/POTFILES.in                      |   99 +++++++++++++++++------------------
 5 files changed, 68 insertions(+), 72 deletions(-)
---
diff --git a/meson.build b/meson.build
index 1aa233e..910c496 100644
--- a/meson.build
+++ b/meson.build
@@ -414,11 +414,6 @@ pkg = import('pkgconfig')
 
 po_dir = join_paths(meson.source_root(), 'po')
 
-intltool_merge = find_program('intltool-merge')
-intltool_cache = join_paths(po_dir, '.intltool-merge-cache')
-intltool_desktop_cmd = [intltool_merge, '-d', '-u', '-c', intltool_cache, po_dir, '@INPUT@', '@OUTPUT@']
-intltool_xml_cmd = [intltool_merge, '-x', '-u', '-c', intltool_cache, po_dir, '@INPUT@', '@OUTPUT@']
-
 top_inc = include_directories('.')
 
 subdir('po')
@@ -432,11 +427,12 @@ desktop = 'nm-applet.desktop'
 # FIXME: The same target can not be copied into two directories.
 #        There is a workaround in meson_post_install.py until proper solution arises:
 #        https://groups.google.com/forum/#!topic/mesonbuild/3iIoYPrN4P0
-custom_target(
+i18n.merge_file(
   desktop,
+  type: 'desktop',
   input: desktop + '.in',
   output: desktop,
-  command: intltool_desktop_cmd,
+  po_dir: po_dir,
   install: true,
   install_dir: nma_appdir
   #install_dir: [
@@ -447,22 +443,23 @@ custom_target(
 
 desktop = 'nm-connection-editor.desktop'
 
-custom_target(
+i18n.merge_file(
   desktop,
+  type: 'desktop',
   input: desktop + '.in',
   output: desktop,
-  command: intltool_desktop_cmd,
+  po_dir: po_dir,
   install: true,
   install_dir: nma_appdir
 )
 
 info = 'nm-connection-editor.metainfo.xml'
 
-custom_target(
+i18n.merge_file(
   info,
   input: 'nm-connection-editor.appdata.xml.in',
   output: info,
-  command: intltool_xml_cmd,
+  po_dir: po_dir,
   install: true,
   install_dir: join_paths(nma_datadir, 'metainfo')
 )
diff --git a/nm-applet.desktop.in b/nm-applet.desktop.in
index 8f94a88..677ed52 100644
--- a/nm-applet.desktop.in
+++ b/nm-applet.desktop.in
@@ -1,6 +1,6 @@
 [Desktop Entry]
-_Name=Network
-_Comment=Manage your network connections
+Name=Network
+Comment=Manage your network connections
 Icon=nm-device-wireless
 Exec=nm-applet
 Terminal=false
diff --git a/nm-connection-editor.appdata.xml.in b/nm-connection-editor.appdata.xml.in
index b59ea74..0c679e9 100644
--- a/nm-connection-editor.appdata.xml.in
+++ b/nm-connection-editor.appdata.xml.in
@@ -4,14 +4,14 @@
   <id>nm-connection-editor.desktop</id>
   <metadata_license>CC0-1.0</metadata_license>
   <project_license>GPL-2.0+</project_license>
-  <_name>NetworkManager</_name>
-  <_summary>NetworkManager connection editor</_summary>
+  <name>NetworkManager</name>
+  <summary>NetworkManager connection editor</summary>
 
   <description>
-    <_p>NetworkManager is a system service for managing and configuring your
-    network connections and devices.</_p>
-    <_p>The nm-connection-editor program works with NetworkManager to create
-    and edit existing connection profiles for NetworkManager.</_p>
+    <p>NetworkManager is a system service for managing and configuring your
+    network connections and devices.</p>
+    <p>The nm-connection-editor program works with NetworkManager to create
+    and edit existing connection profiles for NetworkManager.</p>
   </description>
 
   <screenshots>
@@ -24,5 +24,5 @@
   <url type="bugtracker">https://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager</url>
   <update_contact>networkmanager-maint gnome bugs</update_contact>
   <translation type="gettext">nm-applet</translation>
-  <_developer_name>The NetworkManager Developers</_developer_name>
+  <developer_name>The NetworkManager Developers</developer_name>
 </component>
diff --git a/nm-connection-editor.desktop.in b/nm-connection-editor.desktop.in
index 4eefa8a..1673408 100644
--- a/nm-connection-editor.desktop.in
+++ b/nm-connection-editor.desktop.in
@@ -1,6 +1,6 @@
 [Desktop Entry]
-_Name=Network Connections
-_Comment=Manage and change your network connection settings
+Name=Network Connections
+Comment=Manage and change your network connection settings
 Icon=preferences-system-network
 Exec=nm-connection-editor
 Terminal=false
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 989dafc..5da61f8 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,12 +1,11 @@
-[encoding: UTF-8]
 # List of source files containing translatable strings.
 # Please keep this file sorted alphabetically.
 nm-applet.desktop.in
-nm-connection-editor.desktop.in
-[type: gettext/gsettings]org.gnome.nm-applet.gschema.xml.in
 nm-connection-editor.appdata.xml.in
+nm-connection-editor.desktop.in
+org.gnome.nm-applet.gschema.xml.in
 shared/nm-utils/nm-shared-utils.c
-[type: gettext/glade]src/8021x.ui
+src/8021x.ui
 src/ap-menu-item.c
 src/applet.c
 src/applet-device-broadband.c
@@ -15,42 +14,42 @@ src/applet-device-ethernet.c
 src/applet-device-wifi.c
 src/applet-dialogs.c
 src/applet.h
-[type: gettext/glade]src/connection-editor/ce-ip4-routes.ui
-[type: gettext/glade]src/connection-editor/ce-ip6-routes.ui
-[type: gettext/glade]src/connection-editor/ce-new-connection.ui
-[type: gettest/glade]src/connection-editor/ce-page-bluetooth.ui
-[type: gettext/glade]src/connection-editor/ce-page-bond.ui
-[type: gettext/glade]src/connection-editor/ce-page-bridge-port.ui
-[type: gettext/glade]src/connection-editor/ce-page-bridge.ui
+src/connection-editor/ce-ip4-routes.ui
+src/connection-editor/ce-ip6-routes.ui
+src/connection-editor/ce-new-connection.ui
+src/connection-editor/ce-page-bluetooth.ui
+src/connection-editor/ce-page-bond.ui
+src/connection-editor/ce-page-bridge-port.ui
+src/connection-editor/ce-page-bridge.ui
 src/connection-editor/ce-page.c
-[type: gettext/glade]src/connection-editor/ce-page-dcb.ui
-[type: gettext/glade]src/connection-editor/ce-page-dsl.ui
-[type: gettext/glade]src/connection-editor/ce-page-ethernet.ui
-[type: gettext/glade]src/connection-editor/ce-page-general.ui
+src/connection-editor/ce-page-dcb.ui
+src/connection-editor/ce-page-dsl.ui
+src/connection-editor/ce-page-ethernet.ui
+src/connection-editor/ce-page-general.ui
 src/connection-editor/ce-page.h
-[type: gettext/glade]src/connection-editor/ce-page-infiniband.ui
-[type: gettext/glade]src/connection-editor/ce-page-ip-tunnel.ui
-[type: gettext/glade]src/connection-editor/ce-page-ip4.ui
-[type: gettext/glade]src/connection-editor/ce-page-ip6.ui
-[type: gettext/glade]src/connection-editor/ce-page-macsec.ui
-[type: gettext/glade]src/connection-editor/ce-page-mobile.ui
-[type: gettext/glade]src/connection-editor/ce-page-ppp.ui
-[type: gettext/glade]src/connection-editor/ce-page-proxy.ui
-[type: gettext/glade]src/connection-editor/ce-page-team-port.ui
-[type: gettext/glade]src/connection-editor/ce-page-team.ui
-[type: gettext/glade]src/connection-editor/ce-page-vlan.ui
-[type: gettext/glade]src/connection-editor/ce-page-wifi-security.ui
-[type: gettext/glade]src/connection-editor/ce-page-wifi.ui
-src/connection-editor/ce-polkit.c
+src/connection-editor/ce-page-infiniband.ui
+src/connection-editor/ce-page-ip-tunnel.ui
+src/connection-editor/ce-page-ip4.ui
+src/connection-editor/ce-page-ip6.ui
+src/connection-editor/ce-page-macsec.ui
+src/connection-editor/ce-page-mobile.ui
+src/connection-editor/ce-page-ppp.ui
+src/connection-editor/ce-page-proxy.ui
+src/connection-editor/ce-page-team-port.ui
+src/connection-editor/ce-page-team.ui
+src/connection-editor/ce-page-vlan.ui
+src/connection-editor/ce-page-wifi-security.ui
+src/connection-editor/ce-page-wifi.ui
 src/connection-editor/ce-polkit-button.c
-[type: gettext/glade]src/connection-editor/ce-ppp-auth-methods.ui
+src/connection-editor/ce-polkit.c
+src/connection-editor/ce-ppp-auth-methods.ui
 src/connection-editor/connection-helpers.c
 src/connection-editor/ip4-routes-dialog.c
 src/connection-editor/ip6-routes-dialog.c
 src/connection-editor/nm-connection-editor.c
-[type: gettext/glade]src/connection-editor/nm-connection-editor.ui
+src/connection-editor/nm-connection-editor.ui
 src/connection-editor/nm-connection-list.c
-[type: gettext/glade]src/connection-editor/nm-connection-list.ui
+src/connection-editor/nm-connection-list.ui
 src/connection-editor/page-8021x-security.c
 src/connection-editor/page-bluetooth.c
 src/connection-editor/page-bond.c
@@ -77,51 +76,51 @@ src/connection-editor/page-wifi.c
 src/connection-editor/page-wifi-security.c
 src/connection-editor/vpn-helpers.c
 src/ethernet-dialog.c
-[type: gettext/glade]src/gsm-unlock.ui
-[type: gettext/glade]src/info.ui
+src/gsm-unlock.ui
+src/info.ui
+src/libnma/nma-cert-chooser-button.c
 src/libnma/nma-file-cert-chooser.c
 src/libnma/nma-mobile-providers.c
 src/libnma/nma-mobile-wizard.c
-src/libnma/nma-cert-chooser-button.c
 src/libnma/nma-pkcs11-cert-chooser.c
 src/libnma/nma-pkcs11-cert-chooser-dialog.c
-[type: gettext/glade]src/libnma/nma-pkcs11-cert-chooser-dialog.ui
+src/libnma/nma-pkcs11-cert-chooser-dialog.ui
 src/libnma/nma-pkcs11-token-login-dialog.c
-[type: gettext/glade]src/libnma/nma-pkcs11-token-login-dialog.ui
+src/libnma/nma-pkcs11-token-login-dialog.ui
 src/libnma/nma-ui-utils.c
 src/libnma/nma-vpn-password-dialog.c
 src/libnma/nma-wifi-dialog.c
-[type: gettext/glade]src/libnma/wifi.ui
+src/libnma/wifi.ui
 src/libnm-gtk/nm-mobile-providers.c
 src/libnm-gtk/nm-mobile-wizard.c
 src/libnm-gtk/nm-ui-utils.c
 src/libnm-gtk/nm-vpn-password-dialog.c
 src/libnm-gtk/nm-wifi-dialog.c
 src/libnm-gtk/tests/test-mobile-providers.c
-[type: gettext/glade]src/libnm-gtk/wifi.ui
+src/libnm-gtk/wifi.ui
 src/main.c
 src/mb-menu-item.c
 src/mobile-helpers.c
 src/utils/utils.c
 src/wireless-security/eap-method.c
 src/wireless-security/eap-method-fast.c
-[type: gettext/glade]src/wireless-security/eap-method-fast.ui
+src/wireless-security/eap-method-fast.ui
 src/wireless-security/eap-method-leap.c
-[type: gettext/glade]src/wireless-security/eap-method-leap.ui
+src/wireless-security/eap-method-leap.ui
 src/wireless-security/eap-method-peap.c
-[type: gettext/glade]src/wireless-security/eap-method-peap.ui
+src/wireless-security/eap-method-peap.ui
 src/wireless-security/eap-method-simple.c
-[type: gettext/glade]src/wireless-security/eap-method-simple.ui
+src/wireless-security/eap-method-simple.ui
 src/wireless-security/eap-method-tls.c
-[type: gettext/glade]src/wireless-security/eap-method-tls.ui
+src/wireless-security/eap-method-tls.ui
 src/wireless-security/eap-method-ttls.c
-[type: gettext/glade]src/wireless-security/eap-method-ttls.ui
+src/wireless-security/eap-method-ttls.ui
 src/wireless-security/wireless-security.c
-[type: gettext/glade]src/wireless-security/ws-dynamic-wep.ui
+src/wireless-security/ws-dynamic-wep.ui
 src/wireless-security/ws-leap.c
-[type: gettext/glade]src/wireless-security/ws-leap.ui
+src/wireless-security/ws-leap.ui
 src/wireless-security/ws-wep-key.c
-[type: gettext/glade]src/wireless-security/ws-wep-key.ui
-[type: gettext/glade]src/wireless-security/ws-wpa-eap.ui
+src/wireless-security/ws-wep-key.ui
+src/wireless-security/ws-wpa-eap.ui
 src/wireless-security/ws-wpa-psk.c
-[type: gettext/glade]src/wireless-security/ws-wpa-psk.ui
+src/wireless-security/ws-wpa-psk.ui


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]