[gnome-terminal] build: Migrate from intltool to gettext



commit 2d01dc732d30f689a6b3d960b5556862c610ed27
Author: Martin Blanchard <tchaik gmx com>
Date:   Thu Feb 13 23:31:16 2020 +0100

    build: Migrate from intltool to gettext
    
    Drop the outdated intltool dependency, prefer recent gettext.
    
    https://wiki.gnome.org/Initiatives/GnomeGoals/GettextMigration
    https://wiki.gnome.org/Projects/GnomeCommon/Migration
    
    https://gitlab.gnome.org/GNOME/gnome-terminal/issues/73

 Makefile.am                                 |  7 ++-
 autogen.sh                                  |  1 -
 configure.ac                                | 27 +++++-----
 org.gnome.Terminal.Nautilus.metainfo.xml.in |  6 +--
 org.gnome.Terminal.appdata.xml.in           |  8 +--
 org.gnome.Terminal.desktop.in.in            | 10 ++--
 po/Makevars                                 | 78 +++++++++++++++++++++++++++++
 po/POTFILES.in                              | 13 +++--
 8 files changed, 114 insertions(+), 36 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index cacdc584..eb374169 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -16,7 +16,9 @@ DISTCHECK_CONFIGURE_FLAGS = \
 desktopdir = $(datadir)/applications
 desktop_in_files = org.gnome.Terminal.desktop.in.in
 nodist_desktop_DATA = $(desktop_in_files:.desktop.in.in=.desktop)
-@INTLTOOL_DESKTOP_RULE@
+
+$(nodist_desktop_DATA): $(desktop_in_files:.desktop.in.in=.desktop.in)
+       $(AM_V_GEN)$(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@
 
 DESKTOP_FILE_VALIDATE_FLAGS =
 desktop-file-validate: $(nodist_desktop_DATA)
@@ -38,7 +40,8 @@ if WITH_NAUTILUS_EXTENSION
 nodist_appdata_DATA += org.gnome.Terminal.Nautilus.metainfo.xml
 endif
 
-@INTLTOOL_XML_RULE@
+$(nodist_appdata_DATA): $(appdata_in_files)
+       $(AM_V_GEN) $(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
 
 check-local: desktop-file-validate
 
diff --git a/autogen.sh b/autogen.sh
index dcb8e837..93d05514 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -9,7 +9,6 @@ test -z "$srcdir" && srcdir=.
 cd "$srcdir"
 mkdir -p m4 >/dev/null 2>&1 || true
 autoreconf --verbose --force --install
-intltoolize --force
 cd -
 
 test -n "$NOCONFIGURE" || "$srcdir/configure" "$@"
diff --git a/configure.ac b/configure.ac
index 93ac619e..be0a1d3f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,12 +1,12 @@
-m4_define([gt_version_major],[3])
-m4_define([gt_version_minor],[35])
-m4_define([gt_version_micro],[2])
-m4_define([gt_version_extra],[])
-m4_define([gt_version],[gt_version_major().gt_version_minor().gt_version_micro()gt_version_extra])
+m4_define([terminal_version_major],[3])
+m4_define([terminal_version_minor],[35])
+m4_define([terminal_version_micro],[2])
+m4_define([terminal_version_extra],[])
+m4_define([terminal_version],[terminal_version_major().terminal_version_minor().terminal_version_micro()terminal_version_extra])
 
-m4_define([gt_api_version],[0])
+m4_define([terminal_api_version],[0])
 
-AC_INIT([GNOME 
Terminal],[gt_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-terminal],[gnome-terminal])
+AC_INIT([GNOME 
Terminal],[terminal_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-terminal],[gnome-terminal])
 AC_CONFIG_SRCDIR([src/terminal.c])
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_MACRO_DIR([m4])
@@ -32,9 +32,8 @@ AC_PROG_CC_C99
 AC_ISC_POSIX
 AC_HEADER_STDC
 AM_PROG_LIBTOOL
-IT_PROG_INTLTOOL([0.50.0])
-
-AM_GLIB_GNU_GETTEXT
+AM_GNU_GETTEXT_VERSION([0.19.8])
+AM_GNU_GETTEXT([external])
 
 AX_PTHREAD([],[AC_MSG_ERROR([pthreads are required])])
 
@@ -287,10 +286,10 @@ YELP_HELP_INIT([no-lc-media-links no-lc-dist])
 
 # ****************************
 
-AC_SUBST([TERMINAL_MAJOR_VERSION],[gt_version_major])
-AC_SUBST([TERMINAL_MINOR_VERSION],[gt_version_minor])
-AC_SUBST([TERMINAL_MICRO_VERSION],[gt_version_micro])
-AC_SUBST([TERMINAL_API_VERSION],[gt_api_version])
+AC_SUBST([TERMINAL_MAJOR_VERSION],[terminal_version_major])
+AC_SUBST([TERMINAL_MINOR_VERSION],[terminal_version_minor])
+AC_SUBST([TERMINAL_MICRO_VERSION],[terminal_version_micro])
+AC_SUBST([TERMINAL_API_VERSION],[terminal_api_version])
 AC_SUBST([GTK_API_VERSION])
 AC_SUBST([WARN_CFLAGS])
 AC_SUBST([AM_CPPFLAGS])
diff --git a/org.gnome.Terminal.Nautilus.metainfo.xml.in b/org.gnome.Terminal.Nautilus.metainfo.xml.in
index f9b17064..24aa1018 100644
--- a/org.gnome.Terminal.Nautilus.metainfo.xml.in
+++ b/org.gnome.Terminal.Nautilus.metainfo.xml.in
@@ -36,10 +36,10 @@
   <extends>org.gnome.Nautilus.desktop</extends>
   <metadata_license>GPL-3.0+ or GFDL-1.3-only</metadata_license>
   <project_license>GPL-3.0+</project_license>
-  <_name>Terminal plugin for Files</_name>
-  <_summary>Open a terminal from Files</_summary>
+  <name>Terminal plugin for Files</name>
+  <summary>Open a terminal from Files</summary>
   <description>
-    <_p>Open Terminal is a plugin for the Files application that adds a menu item to the context menu to 
open a terminal in the currently browsed directory.</_p>
+    <p>Open Terminal is a plugin for the Files application that adds a menu item to the context menu to open 
a terminal in the currently browsed directory.</p>
   </description>
   <url type="homepage">https://wiki.gnome.org/Apps/Terminal</url>
   <project_group>GNOME</project_group>
diff --git a/org.gnome.Terminal.appdata.xml.in b/org.gnome.Terminal.appdata.xml.in
index 31aaa302..b411ccdd 100644
--- a/org.gnome.Terminal.appdata.xml.in
+++ b/org.gnome.Terminal.appdata.xml.in
@@ -35,11 +35,11 @@
   <id>org.gnome.Terminal.desktop</id>
   <metadata_license>GPL-3.0+ or GFDL-1.3-only</metadata_license>
   <project_license>GPL-3.0+</project_license>
-  <_name>Terminal</_name>
-  <_summary>Use the command line</_summary>
+  <name>Terminal</name>
+  <summary>Use the command line</summary>
   <description>
-    <_p>GNOME Terminal is a terminal emulator application for accessing a UNIX shell environment which can 
be used to run programs available on your system.</_p>
-    <_p>It supports several profiles, multiple tabs and implements several keyboard shortcuts.</_p>
+    <p>GNOME Terminal is a terminal emulator application for accessing a UNIX shell environment which can be 
used to run programs available on your system.</p>
+    <p>It supports several profiles, multiple tabs and implements several keyboard shortcuts.</p>
   </description>
   <screenshots>
     <screenshot 
type="default">https://help.gnome.org/users/gnome-terminal/stable/figures/gnome-terminal.png</screenshot>
diff --git a/org.gnome.Terminal.desktop.in.in b/org.gnome.Terminal.desktop.in.in
index ae18a544..7b7c44fc 100644
--- a/org.gnome.Terminal.desktop.in.in
+++ b/org.gnome.Terminal.desktop.in.in
@@ -1,8 +1,8 @@
 [Desktop Entry]
 # VERSION=@VERSION@
-_Name=Terminal
-_Comment=Use the command line
-_Keywords=shell;prompt;command;commandline;cmd;
+Name=Terminal
+Comment=Use the command line
+Keywords=shell;prompt;command;commandline;cmd;
 TryExec=gnome-terminal
 Exec=gnome-terminal
 Icon=org.gnome.Terminal
@@ -13,9 +13,9 @@ X-GNOME-SingleWindow=false
 Actions=new-window;preferences;
 
 [Desktop Action new-window]
-_Name=New Window
+Name=New Window
 Exec=gnome-terminal --window
 
 [Desktop Action preferences]
-_Name=Preferences
+Name=Preferences
 Exec=gnome-terminal --preferences
diff --git a/po/Makevars b/po/Makevars
new file mode 100644
index 00000000..41cee61b
--- /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 = gnome-terminal
+
+# 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 = Gnome Terminal copyright holders
+
+# 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/gnome-terminal/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 e377a6f3..7c869fc2 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,26 +1,25 @@
-[encoding: UTF-8]
 # List of source files containing translatable strings.
 # Please keep this file sorted alphabetically.
 org.gnome.Terminal.appdata.xml.in
 org.gnome.Terminal.Nautilus.metainfo.xml.in
 org.gnome.Terminal.desktop.in.in
 src/org.gnome.Terminal.gschema.xml
-[type: gettext/glade]src/preferences.ui
+src/preferences.ui
 src/profile-editor.c
-[type: gettext/glade]src/search-popover.ui
+src/search-popover.ui
 src/server.c
 src/terminal-accels.c
 src/terminal-app.c
 src/terminal.c
-[type: gettext/glade]src/terminal-headerbar.ui
-[type: gettext/glade]src/terminal-headermenu.ui
+src/terminal-headerbar.ui
+src/terminal-headermenu.ui
 src/terminal-headerbar.c
 src/terminal-mdi-container.c
-[type: gettext/glade]src/terminal-menubar.ui.in
+src/terminal-menubar.ui.in
 src/terminal-menu-button.c
 src/terminal-nautilus.c
 src/terminal-notebook.c
-[type: gettext/glade]src/terminal-notebook-menu.ui
+src/terminal-notebook-menu.ui
 src/terminal-options.c
 src/terminal-prefs.c
 src/terminal-screen.c


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