[PATCH 0 of 6] Updated Gettext infrastructure
Martin Geisler
mg at daimi.au.dk
Fri Sep 5 23:11:16 UTC 2008
Hi everybody,
This is an updated version of the patches for enabling translations of
Mercurial:
* Patch 1 restructures the helptable so that the header can be
translated nicely in the next patch.
Changes since last time: I forgot to update doc/gendoc.py, that is
now fixed.
* Patch 2 marks strings in helptable for translation and runs
extension docstrings through gettext.
* Patch 3 is new, it makes gendoc.py use gettext as appropriate
instead of _. This fixes some pygettext.py warnings.
* Patch 4 is also new. It tries to fix the way the record extension
mixes docstrings with prompts and user input.
* Patch 5 makes it easier to find the hg.mo files. The gettext module
would lookup the hg.mo file corresponding to xx.po in
/usr/share/locale/xx/LC_MESSAGES/hg.mo
But that makes it annoying to test new translations and difficult
for people who does not install to that location. So I changed
i18n.py to use a path of . or .., relative to the location of
i18n.py. This is the same way templater.py uses to find the
templates directory.
* Patch 6 adds new targets to the Makefile for updating the hg.pot (PO
template) file and to generate xx.mo files.
Changes since last time: the MANIFEST target makes sure to include
the hg.mo files, and the extraction of docstrings is more precise.
Docstrings are now extracted from:
mercurial/commands.py
hgext/*.py
hgext/*/__init__.py
which I hope catches everything we want. It still finds too many
strings, but I think it is okay to adjust this along the way.
The test suite still passes after these changes! :-)
More information about the Mercurial-devel
mailing list