i18n: beginnings of a Danish translation
Martin Geisler
mg at daimi.au.dk
Sat Jan 17 12:58:56 UTC 2009
Matt Mackall <mpm at selenic.com> writes:
> On Thu, 2009-01-15 at 20:34 +0100, Martin Geisler wrote:
>> > Also, we need to document the best way to turn off l10n, if indeed
>> > want to default to on. That's not completely clear as it has both
>> > compatibility and performance impacts:
>> >
>> > $ hg perfstartup
>> > ! wall 0.049808 comb 0.000000 user 0.000000 sys 0.000000 (best of 100)
>> >
>> > $ LANG=da hg perfstartup
>> > ! wall 0.083391 comb 0.000000 user 0.000000 sys 0.000000 (best of 100)
>> >
>> > Almost all of that is imports that we normally don't need.
>>
>> As for Python module imports, then I believe the code does the same
>> imports as before.
>
> It does, but Mercurial's demandloader avoids actually doing most of
> the imports in the no-translation case. Most of the time is searching
> for and loading a ton of modules to parse the mo file.
We are also wasting time translating all the help strings, even when not
used. I tried changing i18n.gettext to print out the message every time
it is called, and a simple 'hg status' outside a repository results in
419 calls. Only the final two calls to gettext is actually necessary:
There is no Mercurial repository here (.hg not found)
abort: %s!
The other calls are made because all the little pieces of command line
help are translated when the files are loaded, instead of when they are
needed. If we could delay building the mercurial.commands.table dict
until needed, we could probably save some time here.
--
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/20090117/3e9b4c80/attachment.asc>
More information about the Mercurial-devel
mailing list