[gnome-builder] library-template: Port from glib-gettext/intltool to upstream gettext
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] library-template: Port from glib-gettext/intltool to upstream gettext
- Date: Thu, 11 Feb 2016 10:50:36 +0000 (UTC)
commit ffadf66595651c051ae192427990cb74a1f093ec
Author: Philip Withnall <philip withnall collabora co uk>
Date: Sun Jan 31 11:08:05 2016 +0100
library-template: Port from glib-gettext/intltool to upstream gettext
This requires version 0.19.6 of upstream gettext for AppData support:
https://lists.gnu.org/archive/html/info-gnu/2015-09/msg00003.html
It is an error to use glib-gettext and intltool together (as the
template was previously doing) — either use one or the other. However,
both are deprecated in favour of upstream gettext, which is alive again:
https://wiki.gnome.org/Projects/GnomeCommon/Migration#line-204
This has not been extensively tested, but should be the right general
shape.
https://bugzilla.gnome.org/show_bug.cgi?id=761356
.../library-template/library_template/__init__.py | 2 +
.../library_template/shared-library/Makefile.am | 16 -----
.../library_template/shared-library/autogen.sh | 4 -
.../library_template/shared-library/configure.ac | 5 +-
.../library_template/shared-library/po/Makevars | 69 ++++++++++++++++++++
5 files changed, 74 insertions(+), 22 deletions(-)
---
diff --git a/plugins/library-template/library_template/__init__.py
b/plugins/library-template/library_template/__init__.py
index 62ef366..35d67ed 100644
--- a/plugins/library-template/library_template/__init__.py
+++ b/plugins/library-template/library_template/__init__.py
@@ -87,6 +87,7 @@ class LibraryProjectTemplate(Ide.TemplateBase, Ide.ProjectTemplate):
scope.get('enable_gobject_introspection').assign_boolean(True)
scope.get('enable_vala').assign_boolean(True)
scope.get('license').assign_string('/* license */')
+ scope.get('translation_copyright').assign_string('Translation copyright holder')
expands = {
'name': name,
@@ -122,6 +123,7 @@ class LibraryProjectTemplate(Ide.TemplateBase, Ide.ProjectTemplate):
'shared-library/data/package.pc.in': 'data/%(name)s-1.0.pc.in',
'shared-library/data/Makefile.am': 'data/Makefile.am',
+ 'shared-library/po/Makevars': 'po/Makevars',
'shared-library/po/POTFILES.in': 'po/POTFILES.in',
'shared-library/src/Makefile.am': 'src/Makefile.am',
diff --git a/plugins/library-template/library_template/shared-library/Makefile.am
b/plugins/library-template/library_template/shared-library/Makefile.am
index 0bbea60..0e76cd7 100644
--- a/plugins/library-template/library_template/shared-library/Makefile.am
+++ b/plugins/library-template/library_template/shared-library/Makefile.am
@@ -2,22 +2,6 @@ SUBDIRS = data po src
EXTRA_DIST = AUTHORS
-{{if enable_i18n}}
-DISTCLEANFILES = \
- intltool-extract \
- intltool-merge \
- intltool-update \
- po/.intltool-merge-cache
-
-INTLTOOL_FILES = \
- intltool-extract.in \
- intltool-merge.in \
- intltool-update.in \
- $(NULL)
-
-EXTRA_DIST += $(INTLTOOL_FILES)
-{{end}}
-
AUTHORS:
@if test -d "$(srcdir)/.git"; \
then \
diff --git a/plugins/library-template/library_template/shared-library/autogen.sh
b/plugins/library-template/library_template/shared-library/autogen.sh
index 44134b3..d7a2ddd 100644
--- a/plugins/library-template/library_template/shared-library/autogen.sh
+++ b/plugins/library-template/library_template/shared-library/autogen.sh
@@ -23,10 +23,6 @@ if [ "$#" = 0 -a "x$NOCONFIGURE" = "x" ]; then
fi
aclocal --install || exit 1
-{{if enable_i18n}}
-glib-gettextize --force --copy || exit 1
-intltoolize --force --copy --automake || exit 1
-{{end}}
{{if enable_gtk_doc}}
gtkdocize || exit 1
{{end}}
diff --git a/plugins/library-template/library_template/shared-library/configure.ac
b/plugins/library-template/library_template/shared-library/configure.ac
index 51df302..b3caf92 100644
--- a/plugins/library-template/library_template/shared-library/configure.ac
+++ b/plugins/library-template/library_template/shared-library/configure.ac
@@ -47,11 +47,12 @@ AM_MAINTAINER_MODE([enable])
dnl ***********************************************************************
dnl Internationalization
dnl ***********************************************************************
-IT_PROG_INTLTOOL([0.50.1])
GETTEXT_PACKAGE=AC_PACKAGE_TARNAME
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [GETTEXT package name])
-AM_GLIB_GNU_GETTEXT
+
+AM_GNU_GETTEXT_VERSION([0.19.6])
+AM_GNU_GETTEXT([external])
{{end}}
diff --git a/plugins/library-template/library_template/shared-library/po/Makevars
b/plugins/library-template/library_template/shared-library/po/Makevars
new file mode 100644
index 0000000..aa3420c
--- /dev/null
+++ b/plugins/library-template/library_template/shared-library/po/Makevars
@@ -0,0 +1,69 @@
+# Makefile variables for PO directory in any package using GNU gettext.
+
+# Usually the message domain is the same as the package name.
+DOMAIN = $(GETTEXT_DOMAIN)
+
+# These two variables depend on the location of this directory.
+subdir = po
+top_builddir = ..
+
+# These options get passed to xgettext.
+XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ \
+ --keyword=C_:1c,2 --keyword=NC_:1c,2 \
+ --keyword=g_dngettext:2,3 \
+ --flag=g_dngettext:2:pass-c-format \
+ --flag=g_strdup_printf:1:c-format \
+ --flag=g_string_printf:2:c-format \
+ --flag=g_string_append_printf:2:c-format \
+ --flag=g_error_new:3:c-format \
+ --flag=g_set_error:4:c-format \
+ --flag=g_markup_printf_escaped:1:c-format \
+ --flag=g_log:3:c-format \
+ --flag=g_print:1:c-format \
+ --flag=g_printerr:1:c-format \
+ --flag=g_printf:1:c-format \
+ --flag=g_fprintf:2:c-format \
+ --flag=g_sprintf:2:c-format \
+ --flag=g_snprintf:3:c-format
+
+
+# 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 = {{translation_copyright}}
+
+# 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 =
+
+# Ignore the timestamp of the .pot file, as git clones do not have
+# deterministic timestamps, and .po files are updated by translators
+# (only) in GNOME projects.
+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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]