[PATCH 0 of 5] i18n patches

Matt Mackall mpm at selenic.com
Fri Jan 9 19:46:52 CST 2009

On Sat, 2009-01-10 at 01:26 +0100, Martin Geisler wrote:
> Hi everybody,
> Another go of the i18n-patches :-)
> * Patch 1 makes it easier to find the hg.mo files. The gettext module
>   would lookup the hg.mo file corresponding to xx.po in

Seems reasonable.

> * Patch 2 ensures that the output is encoded in the user's local
>   encoding (as given by HGENCODING, LANG, LC_ALL, ...).

This one puzzles me. Shouldn't we instead be choosing a locale file
based on LANG and LC_CTYPE? It seems that if this were the right thing
to do, gettext would be doing it for us as everything using it would
need it.

> * Patch 3 adds new targets to the Makefile for updating the hg.pot (PO
>   template) file and to generate xx.mo files. I've added these files
>   to the .hgignore file.

Is there any reason I'd ever run update-mo directly rather than just
'make'? If not, then we needn't add help for it.

> * Patch 4 adds a rough Danish translation.

Looks like this lives in po/, which seems like an unfortunate directory
name. Can we come up with something better?

> * Patch 5 adds a test case. One *must* run 'make update-mo' after
>   applying this patch, otherwise the test case will fail. The problem
>   is that run-tests.py use the setup.py script to install, and that
>   script does not know anything about generating the .mo files.

Oh, look, an answer to my question. Yeah, we want run-tests.py to just
work. So we can either hack setup.py or run-tests.py

>   I could go in and hack run-tests.py and make it run the Makefile.
>   That would add 'make' and 'msgfmt' to the required_tools in
>   run-tests.py, maybe making it even harder to port the tests.
>   I could also skip the test if no translation is found.

Probably. It's not really important that we test a particular
translation, just that _() works.

Let's figure out the directory name issue, then get patches 1, 3, and 4
in. Then we can figure out what the right answers for 2 and 5 are, ok?

Mathematics is the supreme nostalgia of our time.

More information about the Mercurial-devel mailing list