[Xfce4-commits] <terminal:master> Read the translations during the build.

Nick Schermer noreply at xfce.org
Sun Dec 6 21:12:09 CET 2009


Updating branch refs/heads/master
         to 6c34e11352da5d30cd276e461500e5faeab2b7cc (commit)
       from fe99c255b5efcaeea4639bd2c5f1ab42b0632a1f (commit)

commit 6c34e11352da5d30cd276e461500e5faeab2b7cc
Author: Nick Schermer <nick at xfce.org>
Date:   Sun Dec 6 12:38:29 2009 +0100

    Read the translations during the build.

 configure.in.in    |    4 +--
 doc/Makefile.am    |   60 +++++++++++++++++++++++++--------------------------
 doc/po/Makefile.am |    5 ++++
 3 files changed, 35 insertions(+), 34 deletions(-)

diff --git a/configure.in.in b/configure.in.in
index 86eb81f..516a667 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -73,7 +73,6 @@ dnl *** Check for i18n support ***
 dnl ******************************
 XDT_I18N([@LINGUAS@])
 
-
 dnl ********************************
 dnl *** Check for X11 (optional) ***
 dnl ********************************
@@ -120,8 +119,6 @@ if test x"$enable_gen_doc" = x"yes"; then
     fi
 fi
 AM_CONDITIONAL([GENERATE_DOCUMENTATION], [test x"$enable_gen_doc" = x"yes"])
-DOC_LINGUAS="@LINGUAS@"
-AC_SUBST([DOC_LINGUAS])
 
 dnl ***********************************
 dnl *** Check for debugging support ***
@@ -152,6 +149,7 @@ Terminal.spec
 doc/Makefile
 doc/images/Makefile
 doc/images/ja/Makefile
+doc/po/Makefile
 icons/Makefile
 icons/16x16/Makefile
 icons/24x24/Makefile
diff --git a/doc/Makefile.am b/doc/Makefile.am
index c497a40..4f648ba 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,12 +1,15 @@
 SUBDIRS = \
-	images
+	images \
+	po
 
 STYLESHEET = $(PACKAGE).xsl
 DOCUMENT = $(PACKAGE).xml
+LINGUAS = $(shell cd $(srcdir)/po && echo `/bin/ls *.po | sed 's,[.]po,,g'`)
+ALL_LINGUAS = C $(LINGUAS)
 
 # install the html files to the destdir
 install-data-local:
-	for lang in C $(DOC_LINGUAS); do \
+	for lang in $(ALL_LINGUAS); do \
 		if test -d $(srcdir)/html/$$lang; then \
 			dest=$(DESTDIR)$(docdir)/$$lang; \
 			$(mkinstalldirs) $$dest; \
@@ -24,7 +27,7 @@ install-data-local:
 
 # remove installed files from the destdir
 uninstall-local:
-	for lang in C $(DOC_LINGUAS); do \
+	for lang in $(ALL_LINGUAS); do \
 		dest=$(DESTDIR)$(docdir)/$$lang; \
 		if test -d $$dest; then \
 			if test -L $$dest/images; then \
@@ -41,11 +44,9 @@ if GENERATE_DOCUMENTATION
 update-po:
 	rm -f $(srcdir)/po/$(GETTEXT_PACKAGE).pot; \
 	$(XML2PO) -o $(srcdir)/po/$(GETTEXT_PACKAGE).pot $(srcdir)/$(DOCUMENT); \
-	for lang in $(DOC_LINGUAS); do \
+	for lang in $(LINGUAS); do \
 		pofile=$(srcdir)/po/$$lang.po; \
-		if test -f $$pofile; then \
-			$(XML2PO) -u $(srcdir)/po/$$lang.po $(srcdir)/$(DOCUMENT); \
-		fi \
+		$(XML2PO) -u $(srcdir)/po/$$lang.po $(srcdir)/$(DOCUMENT); \
 	done
 
 # build the (translated) html help files
@@ -55,26 +56,24 @@ html-build.stamp: $(srcdir)/$(DOCUMENT) $(srcdir)/$(STYLESHEET)
 		rm -rf $(srcdir)/html; \
 	fi; \
 	echo; \
-	for lang in C $(DOC_LINGUAS); do \
+	for lang in $(ALL_LINGUAS); do \
 		pofile=$(srcdir)/po/$$lang.po; \
-		if test x"$$lang" = x"C" -o -f $$pofile; then \
-			echo "*** Generating $$lang HTML documentation"; \
-			if test x"$$lang" = x"C"; then \
-				cp $(srcdir)/$(DOCUMENT) xgen-doc; \
-			else \
-				echo "Building the translated DocBook XML file"; \
-				$(XML2PO) -e -l $$lang -p $$pofile $(srcdir)/$(DOCUMENT) > xgen-doc; \
-				rm -f .xml2po.mo; \
-			fi; \
-			sed -e "s,\@PACKAGE_NAME\@,$(PACKAGE_NAME),g" \
-				-e "s,\@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g" \
-				-i xgen-doc; \
-			echo "Creating the HTML pages"; \
-			$(XSLTPROC) --nonet -o $(srcdir)/html/$$lang/ $(srcdir)/$(STYLESHEET) xgen-doc; \
-			chmod -R u+w $(srcdir)/html/$$lang; \
-			rm -f xgen-doc; \
-			echo; \
-		fi \
+		echo "*** Generating $$lang HTML documentation"; \
+		if test x"$$lang" = x"C"; then \
+			cp $(srcdir)/$(DOCUMENT) xgen-doc; \
+		else \
+			echo "Building the translated DocBook XML file"; \
+			$(XML2PO) -e -l $$lang -p $$pofile $(srcdir)/$(DOCUMENT) > xgen-doc; \
+			rm -f .xml2po.mo; \
+		fi; \
+		sed -e "s,\@PACKAGE_NAME\@,$(PACKAGE_NAME),g" \
+			-e "s,\@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g" \
+			-i xgen-doc; \
+		echo "Creating the HTML pages"; \
+		$(XSLTPROC) --nonet -o $(srcdir)/html/$$lang/ $(srcdir)/$(STYLESHEET) xgen-doc; \
+		chmod -R u+w $(srcdir)/html/$$lang; \
+		rm -f xgen-doc; \
+		echo; \
 	done; \
 	touch html-build.stamp
 
@@ -102,15 +101,13 @@ endif
 # a message if no html files were found in the tarball
 all: html-build.stamp
 
-# include the html and po files in the dist
+# include the html files in the dist
 dist-hook: dist-check-doc html-build.stamp
-	for lang in C $(DOC_LINGUAS); do \
+	for lang in $(ALL_LINGUAS); do \
 		if test -d $(srcdir)/html/$$lang; then \
 			mkdir -p $(distdir)/html/$$lang; \
 			cp $(srcdir)/html/$$lang/* $(distdir)/html/$$lang/; \
 		fi; \
-		mkdir -p $(distdir)/po; \
-		cp $(srcdir)/po/*.po $(distdir)/po/; \
 	done
 
 # css file
@@ -121,7 +118,8 @@ css_DATA = \
 EXTRA_DIST = \
 	$(css_DATA) \
 	$(STYLESHEET) \
-	$(DOCUMENT)
+	$(DOCUMENT) \
+	README
 
 CLEANFILES = \
 	xgen-doc \
diff --git a/doc/po/Makefile.am b/doc/po/Makefile.am
new file mode 100644
index 0000000..b48522a
--- /dev/null
+++ b/doc/po/Makefile.am
@@ -0,0 +1,5 @@
+
+PO_FILES=$(shell echo `/bin/ls *.po`)
+EXTRA_DIST = \
+	$(PO_FILES) \
+	$(GETTEXT_PACKAGE).pot



More information about the Xfce4-commits mailing list