[gimp-help-2] [make] Add quickreference pot and po update commands



commit a63af779c23a8a0f1263245c80ee07b2c33c6d74
Author: Ulf-D. Ehlert <ulfehlert svn gnome org>
Date:   Thu Jun 14 20:24:41 2012 +0200

    [make] Add quickreference pot and po update commands

 quickreference/Makefile.am |   35 ++++++++++++++++++++++++++++++++---
 quickreference/README      |   15 +++++++--------
 2 files changed, 39 insertions(+), 11 deletions(-)
---
diff --git a/quickreference/Makefile.am b/quickreference/Makefile.am
index 3ce0e97..94f820a 100644
--- a/quickreference/Makefile.am
+++ b/quickreference/Makefile.am
@@ -24,15 +24,44 @@ EXTRA_DIST = \
 	$(XSL_FILES) \
 	$(TEMPLATES)
 
+COMPENDIUM = Compendium.po
+
+po/gimp-keys.pot: gimp-keys.xml
+	@echo Making $@; \
+	$(XML2PO) $(XML2POFLAGS) $< | $(MSGUNIQ) --width=$(MSGWIDTH) - > $@
+
+po/%.po: po/gimp-keys.pot
+	@echo Making $@; \
+	if [ -f $(top_srcdir)/po/$*/$(COMPENDIUM) ]; then \
+		with_compendium="--compendium=$(top_srcdir)/po/$*/$(COMPENDIUM)"; \
+	fi; \
+	if [ -d "$(GIMP_PO_ROOT)" ]; then \
+		for po in $(GIMP_PO_ROOT)/po*/$*.po; do \
+			with_gimp="$${with_gimp} --compendium=$${po}"; \
+		done; \
+	fi; \
+	if [ ! -s $@ ]; then \
+		$(MSGINIT) $(MSGINITFLAGS) --input=$< --locale=$* --output=$@; \
+	fi; \
+	$(MSGMERGE) $(MSGMERGEFLAGS) $${with_compendium} $${with_gimp} \
+		--update $@ $<; \
+	test -s $@
+
+.PHONY: pot po-% po
+pot: po/gimp-keys.pot ;
+po-%: po/%.po ;
+po: $(foreach lang,$(filter-out en,$(QUICKREFERENCE_LINGUAS)),po-$(lang)) ;
+
 xml/gimp-keys-%.xml: po/%.po gimp-keys.xml
 	$(mkdir_p) xml
 	$(XML2PO) -p $< $(srcdir)/gimp-keys.xml > $@
 
 # English is a special case
 #
-xml/gimp-keys-en.xml: po/gimp-keys.pot gimp-keys.xml
-	$(mkdir_p) xml
-	$(XML2PO) -p $< $(srcdir)/gimp-keys.xml > $@
+.INTERMEDIATE: xml/gimp-keys-en.xml
+xml/gimp-keys-en.xml: gimp-keys.xml
+	$(mkdir_p) xml; \
+	cp $< $@
 
 svg/gimp-keys-%.svg: xml/gimp-keys-%.xml stylesheets/keys-svg.xsl
 	$(mkdir_p) svg
diff --git a/quickreference/README b/quickreference/README
index 2724a03..179527d 100644
--- a/quickreference/README
+++ b/quickreference/README
@@ -1,11 +1,12 @@
 Quickreference
 ==============
 
-If you want to translate the quickreference, copy the po template, use
-the language code for the new file and translate the strings. For
-example:
+If you want to translate the quickreference, create the po template
+and translate the strings. For example:
 
-    cp gimp-keys.pot de.po
+    make po-de
+
+creates po/de.po.
 
 To create an SVG or DocBook/XML compliant file for every translation,
 use make:
@@ -20,11 +21,9 @@ The files can be found in either 'svg' or 'docbook' directories
 Update PO files if the POT has changed
 ======================================
 
-You can update the <LANG-CODE>.po files with intltool-update:
-
-   intltool-update --dist --gettext-package=gimp-keys <LANG-CODE>
+You can update the <LANG-CODE>.po files with make:
 
-See the intltool-update man page for further information.
+   make po-<LANG-CODE>
 
 
 Bugs



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