# HG changeset patch # User Tobias Bell # Date 1238051248 -3600 # Node ID 606723f4a3273a8032e9e3b69a7612f301dfd3b5 # Parent 67e59a9886d5902de5b94cd2552d854b6292ec63 enhance Makefile for language translators To update a po-file just do 'make i18n/xx.po'. No other po-file will be touched. diff -r 67e59a9886d5 -r 606723f4a327 Makefile --- a/Makefile Thu Mar 26 19:01:06 2009 +0900 +++ b/Makefile Thu Mar 26 08:07:28 2009 +0100 @@ -2,6 +2,7 @@ export PREFIX PYTHON=python PURE= +PYTHON_FILES:=$(shell find mercurial hgext doc -name '*.py') help: @echo 'Commonly used make targets:' @@ -76,7 +77,9 @@ test-%: cd tests && $(PYTHON) run-tests.py $(TESTFLAGS) $@ -update-pot: +update-pot: i18n/hg.pot + +i18n/hg.pot: $(PYTHON_FILES) mkdir -p i18n pygettext -d hg -p i18n --docstrings \ mercurial/commands.py hgext/*.py hgext/*/__init__.py @@ -86,10 +89,13 @@ # parse these them even though they are not marked for # translation. Extracting with an explicit encoding of # ISO-8859-1 will make xgettext "parse" and ignore them. - find mercurial hgext doc -name '*.py' | xargs \ + echo $^ | xargs \ xgettext --from-code ISO-8859-1 --join --sort-by-file \ -d hg -p i18n -o hg.pot +%.po: i18n/hg.pot + msgmerge --no-location --update $@ $^ + .PHONY: help all local build doc clean install install-bin install-doc \ install-home install-home-bin install-home-doc dist dist-notests tests \ update-pot