On 5/19/10 6:50 AM, Ed Leafe wrote:
> On May 19, 2010, at 9:37 AM, Paul McNett wrote:
>
>>> Changed string substitution to work with localization
>>
>> I don't understand. You are wanting to translate things like obj.Caption,
>> obj.DefaultButton, obj.Value?
>
>
>       No; the gettext() stuff doesn't work with multiple unnamed 
> substitutions per string. When I run the localization string extraction code, 
> I get a ton of lines like:
>
> /Users/ed/projects/demo/samples/dButton.py:32: warning: 'msgid' format string 
> with unnamed arguments cannot be properly localized:
>       The translator cannot reorder the arguments.
>       Please consider using a format string with named arguments,
>       and a mapping instead of a tuple for the arguments.
>
>
>       I don't completely understand why it can't handle such strings, but it 
> can't, and those strings will not be localized. So I'm converting all such 
> string substitution to named arguments.

Interesting point about not being able to reorder the arguments. I can see why 
this 
would be the case, because the placeholder could appear in a different order in 
the 
translated sentence (adjectives after the noun in Spanish, for instance).

I thought you were running the already formatted strings through gettext(), 
which is 
what I was objecting to.

Paul


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[email protected]

Reply via email to