[gimp-help-2] [make] Switch to customized "xml2po" as default



commit 08455ec4dcd237a9a0728f0f9f6922e1299e4217
Author: Ulf-D. Ehlert <ulfehlert svn gnome org>
Date:   Sun Feb 7 18:03:26 2010 +0100

    [make] Switch to customized "xml2po" as default

 Makefile.am                |   16 +++++++++-------
 configure.ac               |   19 ++++++++++++-------
 quickreference/Makefile.am |    6 ------
 3 files changed, 21 insertions(+), 20 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 66d8d9b..57876a4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -42,7 +42,8 @@ DOC_LINGUAS = $(LINGUAS)
 ## XMLLINT      = xmllint
 XMLLINTFLAGS = --nonet
 ##
-## XML2PO = $(srcdir)/tools/xml2po
+## XML2PO        = $(srcdir)/tools/xml2po.py
+## XML2POFLAGS   = --mode=gimphelp
 ##
 MSGWIDTH      = 79
 ## MSGUNIQ       = msguniq
@@ -147,6 +148,9 @@ XSL_FILES = \
 
 # tools needed for building
 DIST_TOOLS = \
+	make.d \
+	tools/xml2po.py \
+	tools/xml2po \
 	tools/make_image_links.pl
 
 # additional files to be distributed (automake)
@@ -220,10 +224,9 @@ if HAVE_I18N_TOOLS
 #
 # Hint: Don't use 'grep' for filtering-out the warning messages,
 #       since grep's exit status is 1 if there is no match.
-xml2pot = ($(XML2PO) --output='-' $(1) \
+xml2pot = $(XML2PO) $(XML2POFLAGS) --output='-' $(1) \
           | $(MSGUNIQ) $(MSGUNIQFLAGS) \
-          | $(MSGCAT) $(MSGCATFLAGS) - > "$(2)") 2>&1 \
-          | $(SED) -e '/image file .* not found/d'; \
+          | $(MSGCAT) $(MSGCATFLAGS) - > "$(2)"; \
           test -s "$(2)" || rm -f "$(2)"; \
           touch -c -r `ls -t $(1) | $(SED) 1q` "$(2)" || true; \
           test -s "$(2)"
@@ -269,14 +272,13 @@ pot2po = with_compendium="$(shell $(call get_compendium,$3)) \
 #     $2 - PO file containing translations
 #     $3 - translation language
 #     $4 - resulting (translated) XML file
-po2xml = $(XML2PO) --po-file=$(2) --language=$(3) --output=$(4) $(1) 2>&1 \
-         | $(SED) -e '/Warning: image file .* not found./d'; \
+po2xml = $(XML2PO) $(XML2POFLAGS) --po-file=$(2) --language=$(3) --output=$(4) $(1); \
          rm -f .xml2po.mo
 
 else
 
 xml2pot = echo "Error: couldn't find xml2po or gettext tools"; exit 69
-pot2po  = echo "Error: couldn't find xml2po or gettext tools"; exit 69
+pot2po  = echo "Error: couldn't find gettext tools (msgmerge, msginit, msgfmt)"; exit 69
 po2xml  = echo "Error: couldn't find xml2po or gettext tools"; exit 69
 
 endif
diff --git a/configure.ac b/configure.ac
index 4a9bcbe..819daba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -129,14 +129,19 @@ AM_CONDITIONAL(HAVE_DOCBOOK2ODF, test -n "$DOCBOOK2ODF")
 
 
 #  Search for xml2po
+#
+#AC_PATH_PROG(XML2PO, xml2po)
+#if test -z "$XML2PO"; then
+#  AC_MSG_WARN([cannot find xml2po])
+#  missing_i18n_tools="xml2po"
+#fi
+#
+#AM_CONDITIONAL(HAVE_XML2PO, test -n "$XML2PO")
 
-AC_PATH_PROG(XML2PO, xml2po)
-if test -z "$XML2PO"; then
-  AC_MSG_WARN([cannot find xml2po])
-  missing_i18n_tools="xml2po"
-fi
-
-AM_CONDITIONAL(HAVE_XML2PO, test -n "$XML2PO")
+XML2PO='$(srcdir)/tools/xml2po.py'
+XML2POFLAGS="--mode=gimphelp"
+AC_SUBST(XML2PO)
+AC_SUBST(XML2POFLAGS)
 
 
 #  Search for gettext tools
diff --git a/quickreference/Makefile.am b/quickreference/Makefile.am
index 0d023b7..617c59a 100644
--- a/quickreference/Makefile.am
+++ b/quickreference/Makefile.am
@@ -33,8 +33,6 @@ EXTRA_DIST = \
 	$(XSL_FILES) \
 	$(TEMPLATES)
 
-if HAVE_XML2PO
-
 xml/gimp-keys-%.xml: po/%.po gimp-keys.xml
 	$(mkdir_p) xml
 	$(XML2PO) -p $< $(srcdir)/gimp-keys.xml > $@
@@ -45,8 +43,6 @@ xml/gimp-keys-en.xml: po/gimp-keys.pot gimp-keys.xml
 	$(mkdir_p) xml
 	$(XML2PO) -p $< $(srcdir)/gimp-keys.xml > $@
 
-endif
-
 svg/gimp-keys-%.svg: xml/gimp-keys-%.xml stylesheets/keys-svg.xsl
 	$(mkdir_p) svg
 	$(XSLTPROC) \
@@ -65,9 +61,7 @@ docbook/gimp-keys-%.xml: xml/gimp-keys-%.xml stylesheets/keys-docbook.xsl
 
 docbook: $(foreach lang,$(QUICKREFERENCE_LINGUAS),docbook/gimp-keys-$(lang).xml)
 
-if HAVE_XML2PO
 all-local: svg docbook
-endif
 
 clean-local:
 	rm -rf docbook



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