Philipp von Weitershausen wrote:
Florent Guillaume wrote:
I agree that the use case of having translations containing HTML is
important, and thus that we'll have to make sure do_insertStructure_tal
also does correct interpolation when faced with a MessageID.
The Zope 3's TALGenerator/TALInterpreter implementation goes a slightly
Not mentioned in the changelog is a fix for i18n:translate in
combination with structure. But if you look at the diffs of
talinterpreter.py and talgenerator.py, you will see that the generator
now emits the proper bytecode and the interpreter has two new bytecode
handlers, do_insertI18nStructure_tal and do_insertI18nText_tal.
Personally, I would suggest to port this portion of Dmitry's fix. It
might be slightly more complicated than necessary (there are comments
mentioning some unnecessary code duplication), but at least the
ZPT implementations would be kept in sync. This is important for when
we'll switch Zope 2 over to the Zope 3 ZPT implementation some day
(hopefully for Zope 2.10 as Jim mentioned).
If I understand it correctly, these new bytecodes won't help with this
case, which requires do_insertStructure_tal to recognize MessageIDs
coming from Python without i18n:translate="" being explicitly present at
all. This is the same behavior as do_insertText_tal.
do_insertI18nStructure_tal only works for the case where i18n:translate
is used in combination with structure, I think.
Zope3-dev mailing list