Paul McNett wrote:
> Ed Leafe wrote:
>> On Jan 22, 2009, at 2:45 PM, Paul McNett wrote:
>>
>>> -IGNORE_STRING, CHOICE_TRUE, CHOICE_FALSE = (n_("-ignore-"),
>>> - n_("Is True"),
>>> - n_("Is False") )
>>> +IGNORE_STRING, CHOICE_TRUE, CHOICE_FALSE = (_("-ignore-"),
>>> + _("Is True"),
>>> + _("Is False") )
>> OK, this is a good example of why n_() was used. Constants like this
>> are set at import time, and are not evaluated each time through the
>> code. So by using the no-op function, the strings are localized, but
>> not eval'd at import time. Then in the code that uses them, you'd wrap
>> references to them in the _() function, so that they would be
>> localized like other strings at the time they are used.
>
> I'm still not understanding why it matters. Whether you convert the string at
> import
> time or use time, the string gets converted to the same thing.
Ok, I'm understanding, I think: if someone changed the language from 'en' to
'es'
after the app was instantiated, those strings would still be displayed in
English
with newly-instantiated forms.
> Should I revert the commit?
We probably have other places that should be using n_() instead of _(). Perhaps
we
should start a ticket and someone could work on it in the future.
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]