[network-manager-applet: 1/14] build: replace intltool with gettext



commit b3c89c31f8f0ee2cc7ae3e094938846813345d57
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Tue Feb 26 17:37:02 2019 +0100

    build: replace intltool with gettext
    
    Gettext, since version 0.18, provides infrastructure equivalent to
    intltool (generating po/Makefile and translating .desktop files or .xml).
    
    Also, it seems to work better in that it actually honors MSGFMT_OPTS
    that are determined by the configure script. That one typically ends up
    set to "-c", meaning "check". Without it the bugs in the .po files are
    easy to overlook.

 .gitignore                          | 46 ++++++++++++++++-
 .gitlab-ci.yml                      |  2 -
 Makefile.am                         | 19 ++++---
 autogen.sh                          |  4 +-
 configure.ac                        |  4 +-
 meson.build                         | 13 +++--
 nm-applet.desktop.in                |  4 +-
 nm-connection-editor.appdata.xml.in | 14 +++---
 nm-connection-editor.desktop.in     |  4 +-
 po/Makevars                         |  9 ++++
 po/POTFILES.in                      | 99 ++++++++++++++++++-------------------
 11 files changed, 132 insertions(+), 86 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index b93e1ecc..e92fd41b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,6 +13,7 @@ aclocal.m4
 depcomp
 install-sh
 INSTALL
+ABOUT-NLS
 libtool
 ltmain.sh
 missing
@@ -25,13 +26,56 @@ stamp-*
 .libs
 autom4te.cache
 intltool-*
+
+po/boldquot.sed
+po/en@boldquot.header
+po/en@quot.header
 po/*.gmo
-po/*.pot
+po/insert-header.sin
 po/.intltool-merge-cache
+po/Makevars.template
+po/*.pot
+po/quot.sed
+po/remove-potcdate.sed
+po/remove-potcdate.sin
+po/Rules-quot
+
+m4/codeset.m4
+m4/fcntl-o.m4
+m4/gettext.m4
+m4/glibc21.m4
+m4/glibc2.m4
 m4/gtk-doc.m4
+m4/iconv.m4
+m4/intdiv0.m4
+m4/intldir.m4
+m4/intl.m4
+m4/intlmacosx.m4
 m4/intltool.m4
+m4/intmax.m4
+m4/inttypes_h.m4
+m4/inttypes-pri.m4
+m4/lcmessage.m4
+m4/lib-ld.m4
+m4/lib-link.m4
+m4/lib-prefix.m4
 m4/libtool.m4
+m4/lock.m4
+m4/longlong.m4
 m4/lt*.m4
+m4/nls.m4
+m4/po.m4
+m4/printf-posix.m4
+m4/progtest.m4
+m4/size_max.m4
+m4/stdint_h.m4
+m4/threadlib.m4
+m4/uintmax_t.m4
+m4/visibility.m4
+m4/wchar_t.m4
+m4/wint_t.m4
+m4/xsize.m4
+
 test-*.log
 
 /cscope.in.out
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index dd2dfd8a..759c3649 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -14,7 +14,6 @@
       gettext-devel
       glib2-devel
       gtk3-devel
-      intltool
       libgudev1-devel
       libnotify-devel
       libsecret-devel
@@ -32,7 +31,6 @@
       gettext-devel
       glib2-devel
       gtk3-devel
-      intltool
       libgudev1-devel
       libnotify-devel
       libsecret-devel
diff --git a/Makefile.am b/Makefile.am
index 46095319..d0c43aca 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1070,9 +1070,6 @@ TESTS += $(check_programs)
 EXTRA_DIST += \
        linker-script-binary.ver \
        CONTRIBUTING \
-       intltool-extract.in \
-       intltool-merge.in \
-       intltool-update.in \
        Makefile.glib \
        autogen.sh \
        meson.build \
@@ -1088,13 +1085,18 @@ autostartdir = $(sysconfdir)/xdg/autostart
 autostart_in_files = nm-applet.desktop.in
 autostart_DATA = $(autostart_in_files:.desktop.in=.desktop)
 
+nm-applet.desktop: nm-applet.desktop.in
+       $(AM_V_GEN)$(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@
+
 applicationsdir = $(datadir)/applications
 applications_DATA = $(autostart_DATA)
 
 desktopdir = $(datadir)/applications
 desktop_in_files = nm-connection-editor.desktop.in
 desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
-@INTLTOOL_DESKTOP_RULE@
+
+nm-connection-editor.desktop: nm-connection-editor.desktop.in
+       $(AM_V_GEN)$(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@
 
 gsettings_SCHEMAS = org.gnome.nm-applet.gschema.xml
 @GSETTINGS_RULES@
@@ -1102,7 +1104,9 @@ gsettings_SCHEMAS = org.gnome.nm-applet.gschema.xml
 appdatadir = $(datadir)/metainfo
 appdata_DATA = $(appdata_in_files:.xml.in=.xml)
 appdata_in_files = nm-connection-editor.appdata.xml.in
-@INTLTOOL_XML_RULE@
+
+nm-connection-editor.appdata.xml: nm-connection-editor.appdata.xml.in
+       $(AM_V_GEN)$(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
 
 convertdir=$(datadir)/GConf/gsettings
 convert_DATA=nm-applet.convert
@@ -1121,8 +1125,3 @@ CLEANFILES += \
        $(desktop_DATA) \
        $(appdata_DATA) \
        $(BUILT_SOURCES)
-
-DISTCLEANFILES += \
-       intltool-extract \
-       intltool-merge \
-       intltool-update
diff --git a/autogen.sh b/autogen.sh
index 7e8aecb6..cbdc5c44 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -15,9 +15,7 @@ PKG_NAME=nm-applet
 
 (cd $srcdir;
     gtkdocize &&
-    autoreconf --install --symlink &&
-    intltoolize --force &&
-    autoreconf
+    autoreconf --force --install --symlink
 )
 
 if test -z "$NOCONFIGURE"; then
diff --git a/configure.ac b/configure.ac
index 42a49716..6abbca8f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -61,12 +61,12 @@ AC_TYPE_PID_T
 dnl
 dnl translation support
 dnl
-IT_PROG_INTLTOOL([0.50.1])
+AM_GNU_GETTEXT([external])
+AM_GNU_GETTEXT_VERSION([0.18])
 
 GETTEXT_PACKAGE=nm-applet
 AC_SUBST(GETTEXT_PACKAGE)
 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
-AM_GLIB_GNU_GETTEXT
 
 # Check for iso-codes for country names translation
 AC_MSG_CHECKING([whether to disable iso-codes at build-time])
diff --git a/meson.build b/meson.build
index 6ce657c3..80b21abb 100644
--- a/meson.build
+++ b/meson.build
@@ -359,10 +359,9 @@ 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@']
+msgfmt = find_program('msgfmt')
+msgfmt_desktop_cmd = [msgfmt, '--desktop', '--template', '@INPUT@', '-d', po_dir, '-o', '@OUTPUT@']
+msgfmt_xml_cmd = [msgfmt, '--xml', '--template', '@INPUT@', '-d', po_dir, '-o', '@OUTPUT@']
 
 top_inc = include_directories('.')
 
@@ -381,7 +380,7 @@ custom_target(
   desktop,
   input: desktop + '.in',
   output: desktop,
-  command: intltool_desktop_cmd,
+  command: msgfmt_desktop_cmd,
   install: true,
   install_dir: nma_appdir
   #install_dir: [
@@ -396,7 +395,7 @@ custom_target(
   desktop,
   input: desktop + '.in',
   output: desktop,
-  command: intltool_desktop_cmd,
+  command: msgfmt_desktop_cmd,
   install: true,
   install_dir: nma_appdir
 )
@@ -407,7 +406,7 @@ custom_target(
   appdata,
   input: appdata + '.in',
   output: appdata,
-  command: intltool_xml_cmd,
+  command: msgfmt_xml_cmd,
   install: true,
   install_dir: join_paths(nma_datadir, 'metainfo')
 )
diff --git a/nm-applet.desktop.in b/nm-applet.desktop.in
index 8f94a881..677ed52a 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 be7dd2e6..6d30bf14 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://gitlab.gnome.org/GNOME/network-manager-applet/issues</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 5c94bc36..9b83c675 100644
--- a/nm-connection-editor.desktop.in
+++ b/nm-connection-editor.desktop.in
@@ -1,6 +1,6 @@
 [Desktop Entry]
-_Name=Advanced Network Configuration
-_Comment=Manage and change your network connection settings
+Name=Advanced Network Configuration
+Comment=Manage and change your network connection settings
 Icon=preferences-system-network
 Exec=nm-connection-editor
 Terminal=false
diff --git a/po/Makevars b/po/Makevars
new file mode 100644
index 00000000..aed76ae4
--- /dev/null
+++ b/po/Makevars
@@ -0,0 +1,9 @@
+DOMAIN = $(PACKAGE)
+
+subdir = po
+top_builddir = ..
+
+XGETTEXT_OPTIONS = --from-code=UTF-8 --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=NC_:1c,2 
--keyword=g_dngettext:2,3 --add-comments
+COPYRIGHT_HOLDER = $(PACKAGE) authors
+MSGID_BUGS_ADDRESS = https://gitlab.gnome.org/GNOME/$(PACKAGE)/
+EXTRA_LOCALE_CATEGORIES =
diff --git a/po/POTFILES.in b/po/POTFILES.in
index f2e31720..1c1e86e1 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
+org.gnome.nm-applet.gschema.xml.in
 nm-connection-editor.appdata.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
@@ -16,43 +15,43 @@ src/applet-device-wifi.c
 src/applet-dialogs.c
 src/applet-vpn-request.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-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.c
 src/connection-editor/ce-polkit-button.c
-[type: gettext/glade]src/connection-editor/ce-ppp-auth-methods.ui
+src/connection-editor/ce-ppp-auth-methods.ui
 src/connection-editor/connection-helpers.c
-[type: gettext/glade]src/connection-editor/gtk/menus.ui
+src/connection-editor/gtk/menus.ui
 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
@@ -79,53 +78,53 @@ 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-file-cert-chooser.c
 src/libnma/nma-mobile-providers.c
 src/libnma/nma-mobile-wizard.c
-[type: gettext/glade]src/libnma/nma-mobile-wizard.ui
+src/libnma/nma-mobile-wizard.ui
 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
-[type: gettext/glade]src/libnma/nma-vpn-password-dialog.ui
+src/libnma/nma-vpn-password-dialog.ui
 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]