comparison Makefile @ 7648:02e358a3a8a7

i18n: let Makefile generate i18n/hg.pot The target update-pot extracts strings using pygettext and updates the i18n/hg.pot file. The translators can then use msgmerge to merge the new strings in hg.pot with their xx.po file when they want to. The setup.py file now includes files under both templates/ and i18n/ as data files.
author Martin Geisler <mg@daimi.au.dk>
date Thu, 15 Jan 2009 00:10:54 +0100
parents 3fd4dde37628
children 0641fd8a4bb4
comparison
equal deleted inserted replaced
7647:f7256cd9beff 7648:02e358a3a8a7
11 @echo ' tests - run all tests in the automatic test suite' 11 @echo ' tests - run all tests in the automatic test suite'
12 @echo ' test-foo - run only specified tests (e.g. test-merge1)' 12 @echo ' test-foo - run only specified tests (e.g. test-merge1)'
13 @echo ' dist - run all tests and create a source tarball in dist/' 13 @echo ' dist - run all tests and create a source tarball in dist/'
14 @echo ' clean - remove files created by other targets' 14 @echo ' clean - remove files created by other targets'
15 @echo ' (except installed files or dist source tarball)' 15 @echo ' (except installed files or dist source tarball)'
16 @echo ' update-pot - update i18n/hg.pot'
16 @echo 17 @echo
17 @echo 'Example for a system-wide installation under /usr/local:' 18 @echo 'Example for a system-wide installation under /usr/local:'
18 @echo ' make all && su -c "make install" && hg version' 19 @echo ' make all && su -c "make install" && hg version'
19 @echo 20 @echo
20 @echo 'Example for a local installation (usable in this directory):' 21 @echo 'Example for a local installation (usable in this directory):'
72 cd tests && $(PYTHON) run-tests.py $(TESTFLAGS) 73 cd tests && $(PYTHON) run-tests.py $(TESTFLAGS)
73 74
74 test-%: 75 test-%:
75 cd tests && $(PYTHON) run-tests.py $(TESTFLAGS) $@ 76 cd tests && $(PYTHON) run-tests.py $(TESTFLAGS) $@
76 77
78 update-pot:
79 mkdir -p i18n
80 pygettext -d doc -p i18n --docstrings \
81 mercurial/commands.py hgext/*.py hgext/*/__init__.py
82 pygettext -d all -p i18n mercurial hgext doc
83 msgcat i18n/doc.pot i18n/all.pot > i18n/hg.pot
84 rm i18n/doc.pot i18n/all.pot
77 85
78 .PHONY: help all local build doc clean install install-bin install-doc \ 86 .PHONY: help all local build doc clean install install-bin install-doc \
79 install-home install-home-bin install-home-doc dist dist-notests tests 87 install-home install-home-bin install-home-doc dist dist-notests tests \
88 update-pot