[yelp] Move from intltool to gettext



commit bb457766e67bead6de48ba5a2e49671aeef0d9c3
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Thu Jan 24 22:21:49 2019 +0100

    Move from intltool to gettext
    
    This is to make a migration from autotools to meson easier. Also,
    intltool got obsoleted by gettext.
    
    There are minor differences in some of the translated files, but
    functionally it should not make any difference. But why gettext insist
    on reversing the alphabetic order in the appdata file (so zh_TW comes
    first and cs comes last) is beyond me.
    
    https://gitlab.gnome.org/GNOME/yelp/merge_requests/11

 .gitignore               | 17 ++++++++---
 Makefile.am              | 19 +++++-------
 autogen.sh               |  1 -
 configure.ac             |  4 +--
 data/domains/yelp.pot    |  4 +--
 data/yelp.appdata.xml.in | 24 +++++++--------
 po/Makevars              | 78 ++++++++++++++++++++++++++++++++++++++++++++++++
 po/POTFILES.in           |  1 -
 yelp.desktop.in          |  6 ++--
 9 files changed, 118 insertions(+), 36 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index ad11bf1b..ea86d02e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,6 +16,7 @@ Makefile
 Makefile.in
 yelp
 
+/ABOUT-NLS
 /INSTALL
 /aclocal.m4
 /autom4te.cache/
@@ -35,9 +36,6 @@ yelp
 /mkinstalldirs
 /gtk-doc.make
 /install-sh
-/intltool-extract.in
-/intltool-merge.in
-/intltool-update.in
 /libtool
 /stamp-h1
 /yelp
@@ -51,6 +49,7 @@ yelp
 /data/xslt/mal2html.xsl
 /data/xslt/man2html.xsl
 /data/xslt/yelp-common.xsl
+/data/yelp.appdata.xml
 
 /docs/libyelp/html-build.stamp
 /docs/libyelp/html.stamp
@@ -69,6 +68,7 @@ yelp
 /docs/libyelp/libyelp.signals
 /docs/libyelp/libyelp.types
 /docs/libyelp/scan-build.stamp
+/docs/libyelp/setup-build.stamp
 /docs/libyelp/sgml-build.stamp
 /docs/libyelp/sgml.stamp
 /docs/libyelp/tmpl-build.stamp
@@ -84,11 +84,20 @@ yelp
 /libyelp/yelp-types.h
 
 /po/*.gmo
-/po/.intltool-merge-cache
+/po/boldquot.sed
+/po/en@boldquot.header
+/po/en@quot.header
+/po/insert-header.sin
 /po/Makefile.in.in
+/po/Makevars.template
 /po/missing
 /po/POTFILES
+/po/quot.sed
+/po/remove-potcdate.sed
+/po/remove-potcdate.sin
+/po/Rules-quot
 /po/stamp-it
+/po/stamp-po
 /po/yelp.pot
 
 /tests/test-bz2
diff --git a/Makefile.am b/Makefile.am
index ad256137..8c091cf7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -278,20 +278,17 @@ install-exec-hook:
        rm -f $(DESTDIR)$(bindir)/gnome-help && \
        $(LN_S) yelp $(DESTDIR)$(bindir)/gnome-help
 
-@INTLTOOL_DESKTOP_RULE@
-
 desktopdir = $(datadir)/applications
-desktop_in_files=yelp.desktop.in
-desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
+desktop_DATA = yelp.desktop
+yelp.desktop: ${srcdir}/yelp.desktop.in
+       $(AM_V_GEN)$(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@
 
-@INTLTOOL_XML_RULE@
+data/yelp.appdata.xml: ${srcdir}/data/yelp.appdata.xml.in
+       $(AM_V_GEN)$(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
 
-appstream_in_files = data/yelp.appdata.xml.in
-appstream_XML = $(appstream_in_files:.appdata.xml.in=.appdata.xml)
+appstream_XML = data/yelp.appdata.xml
 @APPSTREAM_XML_RULES@
 
-@INTLTOOL_SCHEMAS_RULE@
-
 gsettings_SCHEMAS = data/org.gnome.yelp.gschema.xml
 @GSETTINGS_RULES@
 
@@ -697,12 +694,12 @@ xsl_DATA = \
        data/xslt/yelp-common.xsl
 
 dist_noinst_DATA = \
-       $(appstream_in_files) \
-       $(desktop_in_files) \
        $(gsettings_SCHEMAS) \
        $(libyelp_libyelp_la_headers) \
        $(noinst_libyelp_libyelp_la_headers) \
        $(yelp_headers) \
+       yelp.desktop.in \
+       data/yelp.appdata.xml.in \
        data/domains/yelp.pot \
        data/domains/yelp.xml.in \
        data/domains/yelp.xml \
diff --git a/autogen.sh b/autogen.sh
index 49329813..d7df4c83 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -33,7 +33,6 @@ fi
 set -x
 
 gtkdocize --copy || exit 1
-intltoolize --force --copy --automake || exit 1
 autoreconf --verbose --force --install -Wno-portability || exit 1
 
 cd "$olddir"
diff --git a/configure.ac b/configure.ac
index cf10258e..049ffe8e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -50,8 +50,8 @@ AC_SUBST(YELP_EXTENSION_CFLAGS)
 AC_SUBST(YELP_EXTENSION_LIBS)
 
 # i18n stuff
-AX_REQUIRE_DEFINED([IT_PROG_INTLTOOL])
-IT_PROG_INTLTOOL([0.41.0])
+AM_GNU_GETTEXT([external])
+AM_GNU_GETTEXT_VERSION([0.19.8])
 
 ALL_LINGUAS="`grep -v '^#' "$srcdir/po/LINGUAS" | tr '\n' ' '`"
 AC_SUBST(ALL_LINGUAS)
diff --git a/data/domains/yelp.pot b/data/domains/yelp.pot
index 8cdef476..aaedfa56 100644
--- a/data/domains/yelp.pot
+++ b/data/domains/yelp.pot
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2012-11-21 23:10-0500\n"
+"POT-Creation-Date: 2019-01-24 21:22+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL li org>\n"
@@ -19,7 +19,7 @@ msgstr ""
 #. 
 #. <string/> - The package to install
 #. 
-#: yelp.xml.in:36
+#: data/domains/yelp.xml.in:36
 msgid "Install <string/>"
 msgstr ""
 
diff --git a/data/yelp.appdata.xml.in b/data/yelp.appdata.xml.in
index 604ab259..41742d27 100644
--- a/data/yelp.appdata.xml.in
+++ b/data/yelp.appdata.xml.in
@@ -1,23 +1,23 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<application>
-  <id type="desktop">yelp.desktop</id>
+<component type="desktop">
+  <id>yelp.desktop</id>
   <metadata_license>CC0-1.0</metadata_license>
   <project_license>GPL-2.0+</project_license>
-  <_name>GNOME Help</_name>
-  <_summary>Help viewer for GNOME</_summary>
+  <name>GNOME Help</name>
+  <summary>Help viewer for GNOME</summary>
   <description>
-    <_p>
+    <p>
       Yelp is the GNOME help viewer. It is the default Mallard viewer, but it
       can also display DocBook, info, man, and HTML documentation.
-    </_p>
-    <_p>
+    </p>
+    <p>
       It makes it easy to find the documentation you need, with interactive
       search and bookmarks.
-    </_p>
-    <_p>
+    </p>
+    <p>
       It also has an editor mode, which shows editorial comments and revision
       statuses when editing Mallard documents.
-    </_p>
+    </p>
   </description>
   <screenshots>
     <screenshot 
type="default">https://wiki.gnome.org/Apps/Yelp?action=AttachFile&amp;do=get&amp;target=yelp_screenshot.png</screenshot>
@@ -27,5 +27,5 @@
   <project_group>GNOME</project_group>
   <compulsory_for_desktop>GNOME</compulsory_for_desktop>
   <translation type="gettext">yelp</translation>
-  <_developer_name>The GNOME Project</_developer_name>
-</application>
+  <developer_name>The GNOME Project</developer_name>
+</component>
diff --git a/po/Makevars b/po/Makevars
new file mode 100644
index 00000000..efd62cb0
--- /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 = yelp
+
+# 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 = Yelp Team and others. See AUTHORS
+
+# 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 =
+
+# 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 e5990393..e2f5d6b8 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,6 +1,5 @@
 # Add files with translateable strings here.
 # Please keep this file sorted alphabetically.
-[encoding: UTF-8]
 data/domains/yelp.pot
 data/yelp.appdata.xml.in
 libyelp/yelp-bz2-decompressor.c
diff --git a/yelp.desktop.in b/yelp.desktop.in
index 809f2898..a3d839c6 100644
--- a/yelp.desktop.in
+++ b/yelp.desktop.in
@@ -1,7 +1,7 @@
 [Desktop Entry]
-_Name=Help
-_Comment=Get help with GNOME
-_Keywords=documentation;information;manual;help;
+Name=Help
+Comment=Get help with GNOME
+Keywords=documentation;information;manual;help;
 OnlyShowIn=GNOME;Unity;
 Exec=yelp %u
 Icon=org.gnome.Yelp


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