[network-manager-sstp/gettext] Closes #45, Migrate to GNU Gettext instead of using intltool




commit 9a27de574fd8094b7ce1c006e80d7eada4347c07
Author: Eivind Næss <eivnaes yahoo com>
Date:   Sun Jun 19 14:45:15 2022 -0700

    Closes #45, Migrate to GNU Gettext instead of using intltool
    
    One of Gnome's initiatives is to migrate to a modern version of msgfmt as
    there are no need for intltool and Glib's dated gettext glue anymore.
    
    Signed-off-by: Eivind Næss <eivnaes yahoo com>

 .gitignore                                   | 78 +++++++++++++++++++++++-----
 Makefile.am                                  | 15 ++----
 appdata/network-manager-sstp.metainfo.xml.in | 11 ++--
 autogen.sh                                   | 25 +++++----
 configure.ac                                 |  9 ++--
 po/Makevars                                  | 78 ++++++++++++++++++++++++++++
 po/POTFILES.in                               |  2 +-
 7 files changed, 175 insertions(+), 43 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 53311c4..b5171f0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,10 +4,7 @@
 *.la
 Makefile
 Makefile.in*
-configure
 compile
-config.*
-aclocal.m4
 depcomp
 install-sh
 libtool
@@ -15,27 +12,80 @@ ltmain.sh
 missing
 mkinstalldirs
 POTFILES
-INSTALL
 *.pot
 .dirstamp
 stamp-*
 .deps
 .libs
-autom4te.cache
-intltool-*
-po/*.gmo
-po/.intltool-merge-cache
-po/.intltool-merge-cache.lock
+cscope.*
+
+/gtk4
+/ABOUT-NLS
+/INSTALL
+/aclocal.m4
+/autom4te.cache
+/config.*
+/configure
+
+auth-dialog/nm-sstp-auth-dialog
+appdata/network-manager-sstp.metainfo.xml
+
 m4/gtk-doc.m4
 m4/intltool.m4
 m4/libtool.m4
 m4/lt*.m4
-appdata/network-manager-sstp.metainfo.xml
-/cscope.*
-/properties/resources.[ch]
-/gtk4
+m4/codeset.m4
+m4/extern-inline.m4
+m4/fcntl-o.m4
+m4/gettext.m4
+m4/gtk-doc.m4
+m4/glibc2.m4
+m4/glibc21.m4
+m4/iconv.m4
+m4/intdiv0.m4
+m4/intl.m4
+m4/intldir.m4
+m4/intlmacosx.m4
+m4/intmax.m4
+m4/inttypes-pri.m4
+m4/inttypes_h.m4
+m4/lcmessage.m4
+m4/lib-ld.m4
+m4/lib-link.m4
+m4/lib-prefix.m4
+m4/lock.m4
+m4/longlong.m4
+m4/nls.m4
+m4/pkg.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
+
+po/*.gmo
+po/.intltool-merge-cache
+po/.intltool-merge-cache.lock
+po/*.gmo
+po/Makevars.template
+po/Rules-quot
+po/boldquot.sed
+po/en@boldquot.header
+po/en@quot.header
+po/insert-header.sin
+po/quot.sed
+po/remove-potcdate.sed
+po/remove-potcdate.sin
+
+properties/resources.[ch]
+
 
-auth-dialog/nm-sstp-auth-dialog
 nm-sstp-service.name
 nm-sstp.desktop
 src/nm-sstp-pppd-service-dbus.c
diff --git a/Makefile.am b/Makefile.am
index 48127e0..8a66ce9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -345,12 +345,13 @@ uninstall-hook:
 endif
 
 appdatadir = $(datadir)/metainfo
+appdata_in_files = appdata/network-manager-sstp.metainfo.xml.in
 appdata_files = $(appdata_in_files:.xml.in=.xml)
 if WITH_GNOME
 appdata_DATA = $(appdata_files)
+$(appdata_DATA): $(appdata_in_files)
+       $(AM_V_GEN)$(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
 endif
-appdata_in_files = appdata/network-manager-sstp.metainfo.xml.in
-@INTLTOOL_XML_RULE@
 
 nm-sstp-service.name: $(srcdir)/nm-sstp-service.name.in
        $(AM_V_GEN) sed -e 's|[@]LIBEXECDIR[@]|$(libexecdir)|g' \
@@ -361,18 +362,10 @@ EXTRA_DIST += \
        nm-sstp-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-sstp.metainfo.xml.in b/appdata/network-manager-sstp.metainfo.xml.in
index 961a5d4..3018b2c 100644
--- a/appdata/network-manager-sstp.metainfo.xml.in
+++ b/appdata/network-manager-sstp.metainfo.xml.in
@@ -6,8 +6,8 @@
   <metadata_license>CC0-1.0</metadata_license>
   <extends>nm-connection-editor.desktop</extends>
   <extends>gnome-control-center.desktop</extends>
-  <_name>SSTP VPN client</_name>
-  <_summary>Client for SSTP virtual private networks</_summary>
+  <name>SSTP VPN client</name>
+  <summary>Client for SSTP virtual private networks</summary>
 
   <keywords>
     <keyword>network</keyword>
@@ -19,12 +19,13 @@
   </keywords>
 
   <description>
-    <_p>Support for configuring SSTP virtual private network connections.</_p>
-    <_p>Compatible with servers following the SSTP specification including the Microsoft servers.</_p>
+    <p>Support for configuring SSTP virtual private network connections.</p>
+    <p>Compatible with servers following the SSTP specification including the Microsoft servers.</p>
   </description>
 
   <screenshots>
     <screenshot type="default">
+      <caption>The main configuration page</caption>
       <image width="632" 
height="596">https://gitlab.gnome.org/GNOME/network-manager-sstp/-/raw/master/appdata/sstp.png</image>
     </screenshot>
     <screenshot>
@@ -37,5 +38,5 @@
   <url type="bugtracker">https://gitlab.gnome.org/GNOME/network-manager-sstp/-/issues</url>
   <update_contact>eivnaes yahoo com</update_contact>
   <translation type="gettext">NetworkManager-sstp</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 a0c69c1..083b4cc 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,22 +1,29 @@
 #!/bin/sh
 # Run this to generate all the initial makefiles, etc.
 
+set -e
+
 srcdir=`dirname $0`
-test -z "$srcdir" && srcdir=.
+if test -z "$srcdir"; then
+    srcdir=.
+fi
+
+olddir=`pwd`
+
 REQUIRED_AUTOMAKE_VERSION=1.9
 PKG_NAME=NetworkManager-sstp
 
 (test -f $srcdir/configure.ac \
   && test -f $srcdir/auth-dialog/main.c) || {
-    echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
-    echo " top-level $PKG_NAME directory"
+    printf "**Error**: Directory "\`$srcdir\'" does not look like the" >&2
+    printf " top-level $PKG_NAME directory" >&2
     exit 1
 }
 
-(cd $srcdir;
-    autoreconf --install --symlink &&
-    intltoolize --force &&
-    autoreconf &&
-    ./configure --enable-maintainer-mode --enable-more-warnings=error $@
-)
+cd $srcdir;
+autoreconf --verbose --force --install || exit 1
 
+cd $olddir
+if test -z "$NOCONFIGURE"; then
+    exec $srcdir/configure --enable-maintainer-mode --enable-more-warnings=error "$@"
+fi
diff --git a/configure.ac b/configure.ac
index 2e7e58f..b7ee5dc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -159,13 +159,16 @@ AM_CONDITIONAL(WITH_GTK4, test "$with_gtk4" != no)
 AM_CONDITIONAL(WITH_LIBNM_GLIB, test "$with_libnm_glib" != no)
 AC_ARG_ENABLE(absolute-paths, AS_HELP_STRING([--enable-absolute-paths], [Use absolute paths to in .name 
files. Useful for development. (default is no)]))
 
+dnl
+dnl translation support
+dnl
+AM_GNU_GETTEXT([external])
+AM_GNU_GETTEXT_VERSION([0.20])
+
 GETTEXT_PACKAGE=NetworkManager-sstp
 AC_SUBST(GETTEXT_PACKAGE)
 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
 
-IT_PROG_INTLTOOL([0.35])
-AM_GLIB_GNU_GETTEXT
-
 PKG_CHECK_MODULES(GNUTLS, [gnutls >= 2.12])
 PKG_CHECK_MODULES(SSTPC, [sstp-client-1.0 >= 1.0.10])
 
diff --git a/po/Makevars b/po/Makevars
new file mode 100644
index 0000000..d3881d3
--- /dev/null
+++ b/po/Makevars
@@ -0,0 +1,78 @@
+# Makefile variables for PO directory in any package using GNU gettext.
+
+# Usually the message domain is the same as the package name.
+DOMAIN = $(PACKAGE)
+
+# These two variables depend on the location of this directory.
+subdir = po
+top_builddir = ..
+
+# These options get passed to xgettext.
+XGETTEXT_OPTIONS = --from-code=UTF-8 --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=NC_:1c,2 
--keyword=g_dngettext:2,3 --add-comments
+
+# This is the copyright holder that gets inserted into the header of the
+# $(DOMAIN).pot file.  Set this to the copyright holder of the surrounding
+# package.  (Note that the msgstr strings, extracted from the package's
+# sources, belong to the copyright holder of the package.)  Translators are
+# expected to transfer the copyright for their translations to this person
+# or entity, or to disclaim their copyright.  The empty string stands for
+# the public domain; in this case the translators are expected to disclaim
+# their copyright.
+COPYRIGHT_HOLDER = Free Software Foundation, Inc.
+
+# This tells whether or not to prepend "GNU " prefix to the package
+# name that gets inserted into the header of the $(DOMAIN).pot file.
+# Possible values are "yes", "no", or empty.  If it is empty, try to
+# detect it automatically by scanning the files in $(top_srcdir) for
+# "GNU packagename" string.
+PACKAGE_GNU = no
+
+# This is the email address or URL to which the translators shall report
+# bugs in the untranslated strings:
+# - Strings which are not entire sentences, see the maintainer guidelines
+#   in the GNU gettext documentation, section 'Preparing Strings'.
+# - Strings which use unclear terms or require additional context to be
+#   understood.
+# - Strings which make invalid assumptions about notation of date, time or
+#   money.
+# - Pluralisation problems.
+# - Incorrect English spelling.
+# - Incorrect formatting.
+# It can be your email address, or a mailing list address where translators
+# can write to without being subscribed, or the URL of a web page through
+# which the translators can contact you.
+MSGID_BUGS_ADDRESS = https://gitlab.gnome.org/GNOME/network-manager-sstp/-/issues
+
+# This is the list of locale categories, beyond LC_MESSAGES, for which the
+# message catalogs shall be used.  It is usually empty.
+EXTRA_LOCALE_CATEGORIES =
+
+# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt'
+# context.  Possible values are "yes" and "no".  Set this to yes if the
+# package uses functions taking also a message context, like pgettext(), or
+# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument.
+USE_MSGCTXT = yes
+
+# These options get passed to msgmerge.
+# Useful options are in particular:
+#   --previous            to keep previous msgids of translated messages,
+#   --quiet               to reduce the verbosity.
+MSGMERGE_OPTIONS =
+
+# These options get passed to msginit.
+# If you want to disable line wrapping when writing PO files, add
+# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and
+# MSGINIT_OPTIONS.
+MSGINIT_OPTIONS =
+
+# This tells whether or not to regenerate a PO file when $(DOMAIN).pot
+# has changed.  Possible values are "yes" and "no".  Set this to no if
+# the POT file is checked in the repository and the version control
+# program ignores timestamps.
+PO_DEPENDS_ON_POT = no
+
+# This tells whether or not to forcibly update $(DOMAIN).pot and
+# regenerate PO files on "make dist".  Possible values are "yes" and
+# "no".  Set this to no if the POT file and PO files are maintained
+# externally.
+DIST_DEPENDS_ON_UPDATE_PO = no
diff --git a/po/POTFILES.in b/po/POTFILES.in
index bfa6f27..cfd971c 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -3,10 +3,10 @@
 appdata/network-manager-sstp.metainfo.xml.in
 auth-dialog/main.c
 properties/advanced-dialog.c
+properties/nm-sstp-dialog.ui
 properties/nm-sstp-editor-plugin.c
 properties/nm-sstp-editor.c
 shared/nm-utils/nm-shared-utils.c
 shared/nm-utils/nm-vpn-plugin-utils.c
 shared/utils.c
 src/nm-sstp-service.c
-[type: gettext/glade]properties/nm-sstp-dialog.ui


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