diff --git a/Makefile b/Makefile --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ PREFIX=/usr/local export PREFIX PYTHON=python PURE= +PYTHON_FILES:=$(shell find mercurial hgext doc -name '*.py') help: @echo 'Commonly used make targets:' @@ -76,7 +77,9 @@ tests: 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 @@ update-pot: # 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