[PATCH 0 of 5] i18n patches

Martin Geisler mg at daimi.au.dk
Wed Jan 14 23:24:20 UTC 2009


Matt Mackall <mpm at selenic.com> writes:

> On Sat, 2009-01-10 at 10:34 +0100, Martin Geisler wrote:
>> Matt Mackall <mpm at selenic.com> writes:
>>
>> I think this is the common name for translations, but I agree that it
>> is silly :-) We could calls it 'translations' (long but clear) or
>> 'i18n' (nice and short).
>
> Let's go with i18n/ then.

Okay, I've moved the translation to i18n/.

>> >> * 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
>> 
>> It would be easiest to change run-tests.py, but more correct to
>> change setup.py so that 'python setup.py install' could still give a
>> complete install.
>
> Alright, let's aim to fix setup.py.

It turned out that it wasn't that hard to make setup.py do the building.
The updated patch series does that.

>> Would it be okay if we include pygettext.py and msgfmt.py directly
>> with Mercurial? They seem very stable with no change in 2 and 4
>> years:
>>
>>   http://svn.python.org/view/python/trunk/Tools/i18n/
>
> I'd rather not. We can provide a URL for it.

Good idea.

>> >>   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.
>> 
>> Yes. The current test also makes sure that Gettext transcodes the
>> text properly: the da.po file is in Latin1, but the test asks and
>> tests for UTF-8 output.
>
> We can also do this test with a trivial .po file and a trivial 'import
> _; print _('foo')'.

I have not adressed this in my latest patchbomb -- but I think you're
right that a dummy test would be better since the test case I made is
quite brittle: if the docstring in churn is changed, the test will fail
until I or someone else updates the Danish translation...

-- 
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-devel/attachments/20090115/03db2a37/attachment.asc>


More information about the Mercurial-devel mailing list