[orca/tchaik/gettext-migration] Migrate from intltool to gettext



commit a312679b2ae9832be6ef66fc35607ba3d080324a
Author: Martin Blanchard <tchaik gmx com>
Date:   Thu Mar 14 00:37:47 2019 +0000

    Migrate from intltool to gettext
    
    Recent gettext version can extract and merge back strings from and to
    various file formats, no need for  intltool anymore.
    
    https://wiki.gnome.org/Initiatives/GnomeGoals/GettextMigration
    
    https://gitlab.gnome.org/GNOME/orca/issues/35

 Makefile.am    |  3 ++-
 autogen.sh     |  5 ----
 configure.ac   |  5 ++--
 m4/.gitignore  |  1 -
 po/.gitignore  |  1 -
 po/Makevars    | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 po/POTFILES.in |  5 ++--
 7 files changed, 85 insertions(+), 13 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 9b9aa7d72..c763ac759 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -26,7 +26,8 @@ autostartdir   = $(sysconfdir)/xdg/autostart
 autostart_in_files = orca-autostart.desktop.in
 autostart_DATA   = $(autostart_in_files:.desktop.in=.desktop)
 
-@INTLTOOL_DESKTOP_RULE@
+$(autostart_DATA): $(autostart_in_files)
+       $(AM_V_GEN)$(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@
 
 EXTRA_DIST =                \
        $(autostart_in_files) \
diff --git a/autogen.sh b/autogen.sh
index 3c97bb5a0..b636f0d0d 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -27,11 +27,6 @@ aclocal --install || {
         exit 1
 }
 
-intltoolize --force --copy --automake || {
-        echo "Try installing the 'intltool' package."
-        exit 1
-}
-
 autoreconf --verbose --force --install -Wno-portability  || {
         echo "Try installing the 'autoconf' package."
         exit 1
diff --git a/configure.ac b/configure.ac
index 521c0d6ba..a4495607f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,7 +19,8 @@ AM_INIT_AUTOMAKE([1.11 tar-ustar no-dist-gzip dist-xz])
 AM_MAINTAINER_MODE([enable])
 
 dnl Gettext stuff
-IT_PROG_INTLTOOL([0.50.0])
+AM_GNU_GETTEXT_VERSION([0.19.8])
+AM_GNU_GETTEXT([external])
 
 GETTEXT_PACKAGE=AC_PACKAGE_TARNAME
 AC_SUBST(GETTEXT_PACKAGE)
@@ -77,7 +78,7 @@ case "${PLATFORM}" in
 esac
 AC_SUBST(PLATFORM_PATH)
 
-AC_OUTPUT([ 
+AC_OUTPUT([
 run_pylint.sh
 Makefile
 docs/Makefile
diff --git a/m4/.gitignore b/m4/.gitignore
index 0bda77b4d..6a524b07a 100644
--- a/m4/.gitignore
+++ b/m4/.gitignore
@@ -7,7 +7,6 @@ intdiv0.m4
 intl.m4
 intldir.m4
 intlmacosx.m4
-intltool.m4
 intmax.m4
 inttypes-pri.m4
 inttypes_h.m4
diff --git a/po/.gitignore b/po/.gitignore
index c67692139..09eb1bcaf 100644
--- a/po/.gitignore
+++ b/po/.gitignore
@@ -13,7 +13,6 @@ po2tbl.sed
 po2tbl.sed.in
 stamp-cat-id
 stamp-it
-.intltool-merge-cache
 Makevars.template
 Rules-quot
 boldquot.sed
diff --git a/po/Makevars b/po/Makevars
new file mode 100644
index 000000000..3fed4becf
--- /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 = The Orca Team.
+
+# 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/orca/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 61c32b217..25940c7b4 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,6 +1,5 @@
 # List of source files containing translatable strings.
 # Please keep this file sorted alphabetically.
-[encoding: UTF-8]
 orca-autostart.desktop.in
 src/orca/braille_rolenames.py
 src/orca/brltablenames.py
@@ -14,8 +13,8 @@ src/orca/mathsymbols.py
 src/orca/messages.py
 src/orca/notification_messages.py
 src/orca/object_properties.py
-[type: gettext/glade]src/orca/orca-find.ui
-[type: gettext/glade]src/orca/orca-setup.ui
+src/orca/orca-find.ui
+src/orca/orca-setup.ui
 src/orca/phonnames.py
 src/orca/text_attribute_names.py
 src/orca/tutorialgenerator.py


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