seb bacon wrote:

On Thu, Feb 19, 2004 at 09:10:30AM -0500, Stephan Richter wrote:

On Thursday 19 February 2004 08:08, seb bacon wrote:

Zope 2.7 introduced a change in its translation interface.  Previously a
translation service could return None, but now returning None causes an
assertion error.

That is strange. The Zope 3 translation service can also still return None and
we use the same TAL code. I cannot see which code change would not handle the

The new implementation would appear to expect the service to return the default value passed in, instead of None.

From the diff linked to above:

r1.77 has:

 xlated_msgid = self.translate(msgid, i18ndict, obj)
    # If there is no translation available, use evaluated content.
    if xlated_msgid is None:
       # do some stuff

r1.78 has:

 xlated_msgid = self.translate(msgid, default, i18ndict, obj)
 assert xlated_msgid is not None, self.position

I always commented all asserts introduced in newer Zopes out. However
I'm struggling with assertion "TALInterpreter, line 490, in
   def do_endI18nContext(self, notused=None):
       self.i18nContext = self.i18nContext.parent
       assert self.i18nContext is not None
Meaning None was produced somewhere (maybe even Translation Service) and
TALInterpreter does not expect this case to be.

Myroslav Opyr <>  Ukrainian Zope Hosting

_______________________________________________ Zope-Dev maillist - [EMAIL PROTECTED] ** No cross posts or HTML encoding! ** (Related lists - )

Reply via email to