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

Philipp von Weitershausen philipp at weitershausen.de
Tue Sep 21 04:13:10 EDT 2004


Godefroid Chapelle <gotcha at bubblenet.be> wrote:

> >>>> 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.

Well, I spoke too quick. You were right :).

> Which I think is very good.

I'm not sure that I like this behaviour but it is there and we need ZPTs to be 
consistent. As you are very well aware of, TAL already depends on 
zope.i18nmessageid and therefore does the automatic translation, whereas the 
TALES does not depend on zope.i18nmessageid, therefore the string expression 
does not handle the automatic translation.

Unless Fred finds a better way to do this *wink*, we should consider the 
possibility of having TALES depend on zope.i18nmessageid for consistency's 
sake. Note that the dependency could be a weak one, such as:

try:
  from zope.i18nmessageid import MessageID
except ImportError
  class MessageID(object): pass

Philipp



More information about the Zope3-dev mailing list