[PATCH 0 of 4] Simpler Gettext infrastructure
Martin Geisler
mg at daimi.au.dk
Fri Aug 22 20:51:13 UTC 2008
Hello everybody!
This is a re-send of my Gettext patch series. It now has a simpler way
to lookup the xx.mo files which will work with both Mercurial itself
and third-party extensions.
* Patch 1 removes some code that tried to make plural forms by
appending 's'.
* Patch 2 marks some extra strings for translation.
* Patch 3 makes it easier to find the xx.mo files. The gettext module
would lookup xx.mo in
/usr/share/locale/xx/LC_MESSAGES/hg.mo
or something like that. 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 4 adds new targets to the Makefile for updating the hg.pot (PO
template) file and to generate xx.mo files. I don't particularly
like the update-mo target name I chose -- maybe someone can come up
with something better.
I have split off the big hg.pot and da.po patches. I think many
projects put the .pot file under revision control, but I'm not sure
why since it is auto-generated.
Anyway, please give it a try and let me know what you think! You can
create a new language by going to the po directory and running
msginit -l xx
or simply copy the hg.pot file to xx.po where xx is your language code
(not country code: da vs dk). Then edit away and run
make update-mo
from the root to compile the .po file into a .mo file. Then set
LANG=xx and run hg.
More information about the Mercurial-devel
mailing list