[Zope3-dev] Re: translate() default value

Philipp von Weitershausen philipp at weitershausen.de
Tue Jul 26 08:55:03 EDT 2005


Benji York wrote:
> Dmitry Vasiliev wrote:
> 
>> The simplest solution is to change all translate(text) calls to 
>> translate(text, default=text). I think we need to do it for 3.1 also.
> 
> So we'd either have to duplicate the message text, or place all text in 
> a variable first, and pass it as both arguments?
> 
>     translate('my message text', text='my message text')
> 
> Perhaps a switch would be more appropriate.  Something like (with a 
> better parameter name):
> 
>     translate('my message text', text_is_default=True)

Well, I understood Dmitry's original posting (the start of the thread), that

     translate('my message text')

would be made equivalent to

     translate('my message text', default='my message text')

Right now, it's equivalent to

     translate('my message text', default=None)

which causes lots of problems because you would really expect to always 
get a (unicode) string back from translate(). (see the issue Dmitry's 
mentioning).

Philipp


More information about the Zope3-dev mailing list