[PATCH 1 of 2] fix string concatenation in string marked for translation

Martin Geisler mg at daimi.au.dk
Wed Aug 20 03:15:51 CDT 2008


Dirkjan Ochtman <dirkjan at ochtman.nl> writes:

Hi Dirkjan, thanks for looking at this!

> Martin Geisler <mg <at> daimi.au.dk> writes:
>> @@ -93,8 +93,8 @@
>> -            _ui.warn(_("WARNING: [win32mbcs] filename conversion fail for" +
>> -                     " %s: '%s'\n") % (util._encoding, args))
>> +            _ui.warn(_("WARNING: [win32mbcs] filename conversion fail for"
>> +                       " %s: '%s'\n") % (util._encoding, args))
>
> Why is this necessary? These seem functionally equivalent.

Yes, they are equivalent at runtime, but 1) it is a little nicer to
let the Python bytecode compiler concatanate the two strings instead
of doing it at runtime, and 2) it is necessary to make pygettext.py
extract the strings.

So if the source contains

  _("foo" "bar")

then pygettext.py will know to include

  foobar

in the .po file. But if pygettext.py sees something different from a
string litteral, it doesn't know what to do, and wont include
anything.

-- 
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multi-Party Computation) to Python. See: http://viff.dk/.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
Url : http://selenic.com/pipermail/mercurial-devel/attachments/20080820/c2363389/attachment.pgp 


More information about the Mercurial-devel mailing list