[NetworkManager-pptp/lr/gettext] build: replace intltool with gettext




commit 5aae51b5ceabada579bddf7bb41350b87aad55ab
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Mon Jun 27 16:34:14 2022 +0200

    build: replace intltool with gettext
    
    Gettext, since version 0.19, 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                                   | 23 ++++++++++++++++++++++-
 .gitlab-ci.yml                               |  1 -
 Makefile.am                                  | 14 ++++----------
 appdata/network-manager-pptp.metainfo.xml.in | 10 +++++-----
 autogen.sh                                   |  2 --
 configure.ac                                 |  6 ++++--
 po/Makevars                                  |  9 +++++++++
 po/POTFILES.in                               |  2 +-
 8 files changed, 45 insertions(+), 22 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index c79ca37..d8119f6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@
 *.o
 *.lo
 *.la
+ABOUT-NLS
 Makefile
 Makefile.in*
 configure
@@ -23,13 +24,33 @@ stamp-*
 .libs
 autom4te.cache
 intltool-*
-po/*.gmo
 po/.intltool-merge-cache
+po/*.gmo
+po/boldquot.sed
+po/en@boldquot.header
+po/en@quot.header
+po/insert-header.sin
+po/Makevars.template
+po/quot.sed
+po/remove-potcdate.sed
+po/remove-potcdate.sin
+po/Rules-quot
+m4/gettext.m4
 m4/gtk-doc.m4
+m4/host-cpu-c-abi.m4
+m4/iconv.m4
+m4/intlmacosx.m4
 m4/intltool.m4
+m4/lib-ld.m4
+m4/lib-link.m4
+m4/lib-prefix.m4
 m4/libtool.m4
 m4/lt*.m4
+m4/nls.m4
+m4/po.m4
+m4/progtest.m4
 appdata/network-manager-pptp.metainfo.xml
+
 /cscope.*
 /properties/resources.[ch]
 /gtk4
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 47ca9b8..aa20394 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -13,7 +13,6 @@
       gettext-devel
       glib2-devel
       gtk3-devel
-      intltool
       libtool
       libsecret-devel
       libnma-devel
diff --git a/Makefile.am b/Makefile.am
index ef7314f..eaf08ca 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -318,7 +318,9 @@ if WITH_GNOME
 appdata_DATA = $(appdata_files)
 endif
 appdata_in_files = appdata/network-manager-pptp.metainfo.xml.in
-@INTLTOOL_XML_RULE@
+
+appdata/network-manager-pptp.metainfo.xml: appdata/network-manager-pptp.metainfo.xml.in
+       $(AM_V_GEN)$(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
 
 nm-pptp-service.name: $(srcdir)/nm-pptp-service.name.in
        $(AM_V_GEN) sed -e 's|[@]LIBEXECDIR[@]|$(libexecdir)|g' \
@@ -329,18 +331,10 @@ EXTRA_DIST += \
        nm-pptp-service.name.in \
        $(dbusservice_DATA) \
        $(appdata_in_files) \
-       $(appdata_files) \
-       intltool-extract.in \
-       intltool-merge.in \
-       intltool-update.in
+       $(appdata_files)
 
 CLEANFILES += \
        $(nmvpnservice_DATA) \
        $(appdata_files)
 
-DISTCLEANFILES = \
-       intltool-extract \
-       intltool-merge \
-       intltool-update
-
 ACLOCAL_AMFLAGS = -I m4
diff --git a/appdata/network-manager-pptp.metainfo.xml.in b/appdata/network-manager-pptp.metainfo.xml.in
index 964cd98..5f6631b 100644
--- a/appdata/network-manager-pptp.metainfo.xml.in
+++ b/appdata/network-manager-pptp.metainfo.xml.in
@@ -7,8 +7,8 @@
   <extends>nm-connection-editor.desktop</extends>
   <extends>org.gnome.Settings.desktop</extends>
   <extends>gnome-control-center.desktop</extends>
-  <_name>PPTP VPN client</_name>
-  <_summary>Client for PPTP virtual private networks</_summary>
+  <name>PPTP VPN client</name>
+  <summary>Client for PPTP virtual private networks</summary>
 
   <keywords>
     <keyword>network</keyword>
@@ -20,8 +20,8 @@
   </keywords>
 
   <description>
-    <_p>Support for configuring PPTP virtual private network connections.</_p>
-    <_p>Compatible with various PPTP servers including Microsoft.</_p>
+    <p>Support for configuring PPTP virtual private network connections.</p>
+    <p>Compatible with various PPTP servers including Microsoft.</p>
   </description>
 
   <screenshots>
@@ -38,5 +38,5 @@
   <url type="bugtracker">https://gitlab.gnome.org/GNOME/NetworkManager-pptp/issues</url>
   <update_contact>networkmanager-maint gnome bugs</update_contact>
   <translation type="gettext">NetworkManager-pptp</translation>
-  <_developer_name>The NetworkManager Developers</_developer_name>
+  <developer_name>The NetworkManager Developers</developer_name>
 </component>
diff --git a/autogen.sh b/autogen.sh
index aaa7471..4ed20c6 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -15,8 +15,6 @@ PKG_NAME=NetworkManager-pptp
 
 (cd $srcdir;
     autoreconf --install --symlink &&
-    intltoolize --force &&
-    autoreconf &&
     ./configure --enable-maintainer-mode --enable-more-warnings=error $@
 )
 
diff --git a/configure.ac b/configure.ac
index 7bfc9fb..117b7c4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -106,8 +106,10 @@ GETTEXT_PACKAGE=NetworkManager-pptp
 AC_SUBST(GETTEXT_PACKAGE)
 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
 
-IT_PROG_INTLTOOL([0.35])
-AM_GLIB_GNU_GETTEXT
+AM_GNU_GETTEXT([external])
+# Remove AM_GNU_GETTEXT_VERSION once autoreconf supports REQUIRE_VERSION
+AM_GNU_GETTEXT_VERSION([0.19])
+AM_GNU_GETTEXT_REQUIRE_VERSION([0.19])
 
 # gio-unix will require glib and gio
 PKG_CHECK_MODULES(GLIB, gmodule-2.0 gio-unix-2.0 >= 2.34)
diff --git a/po/Makevars b/po/Makevars
new file mode 100644
index 0000000..aed76ae
--- /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 1a8e283..dc3b8cb 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -8,4 +8,4 @@ properties/nm-pptp-editor.c
 shared/nm-utils/nm-shared-utils.c
 shared/nm-utils/nm-vpn-plugin-utils.c
 src/nm-pptp-service.c
-[type: gettext/glade]properties/nm-pptp-dialog.ui
+properties/nm-pptp-dialog.ui


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