[Zope3-dev] Re: Use case not covered for translation of message ids

Godefroid Chapelle gotcha at bubblenet.be
Sun Sep 19 06:25:01 EDT 2004


Philipp von Weitershausen wrote:

> Godefroid Chapelle wrote:
> 
>>>> Anyway, in the first case, the developer made his part of the job 
>>>> correctly : he said that this value should be translated.
>>>
>>>
>>> No, where did he?
>>
>>
>> In the Python code when he used a MessageID and not a string.
> 
> 
> That does not imply translation yet. Not even in Python code:
> 
>   >>> msg = _(u'foobar')
>   >>> from zope.i18n import translate
>   >>> translate(msg)
>   ...
> 
>>>> So we think that even if the template is badly written, the message 
>>>> id should be translated.
>>>
>>>
>>> I disagree. There was no markup whatsoever that told ZPT to translate.
>>
>>
>> I think you do not know that there is no need for explicit use of 
>> i18n:translate when rendering a MessageID. The interpreter finds out 
>> by itself and translate.
> 
> 
> That is not how it works anywhere. 

As I know I often speak too quick, I tested it before stating it : 
downloaded Zope X3 release candidate, went to contents.py, added a msgid 
attribute to the view, allowed it in configure.zcml, showed it in the 
contents.pt _without_ i18n:translate and it showed up translated.

Which I think is very good.

> Translation is explicit. Why should 
> we change that?
> 
>> This let each member of the team manage his part of the job : python 
>> coders take care of strings that should be translated by using 
>> MessageID and template designers take of their strings by inserting 
>> i18n namespace where needed.
>>
>> With the current implementation, the template designer does not need 
>> to know if what he'll get from the python code needs to be translated 
>> or not : which is good imho.
> 
> 
> No, it's not. Translation needs to be explicit, IMO.

explicit vs implicit is not a all or nothing rule : the python code is 
explicitely stating there should be translation. Which is enough...
> 
> Philipp

Godefroid


More information about the Zope3-dev mailing list