On Wednesday 27 April 2005 08:28, Dmitry Vasiliev wrote:
> I want to fix Issue 301 "Bug with i18n:name and i18n:translate on the same
> element" (http://www.zope.org/Collectors/Zope3-dev/301) but there are some
> open questions...


> Should '<span i18n:name="foo">bar</span>' pass '<span>bar</span>' to the
> msgid mapping or just 'bar'?

Wow, so this gets hairy and we need to get it right. Unfortunately, tests 
right now support both practices. So here are my observations:

<p i18n:translate="">
  This house is <em i18n:name="color" i18n:translate="">red</em>.

The case above should produce two message ids:

"This house is $color."

Note: The XML element containing i18n:name is *not* part of the second message 
id. Also, the <em> tag is not part of the outer message id.

So here is the way to think about this. The I18n name, as seen from the outer 
translation is the entire <em> element. However, the <em> element itself only 
sends its content out as a message id. 

Further, there need to be some rules deciding when the <em> tag should be 
omitted. I agree with Marius and Godefroid that it should only be omitted 
when either "tal:replace" or "tal:omit-tag" is specified. 

It thus follows:

- test_content_with_messageid_and_i18nname in test_talinterpreter.py is 

- test36.html is incorrect.

- Marius' submitted test is correct.

> In the latter case which additional attributes should preserve the tag in
> the msgid mapping? 

All attributes inside the tag should be preserved, but nothing of the tag (I 
mean everything inside < >) should be submitted for translation.

> For example: 
> '<span i18n:name="foo" i18n:translate="">bar</span>' => 'bar' (translated)

This would be incorrect.

> but
> '<a href="url" i18n:name="foo" i18n:translate="">bar</a>' => '<a
> href="url">bar</a>' ('bar' translated)

This is correct.

Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
Zope3-dev mailing list
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to