[Zope-Coders] Re: [Zip] i18n:attributes in 2.7

Jim Fulton jim@zope.com
Fri, 25 Jul 2003 08:17:20 -0400


Godefroid Chapelle wrote:
> Hi all,
> 
> I am currently working on Silva i18n. This led me to take a look at the 
> code for i18n:attributes.
> 
> I'll try to explain the current situation :
> 
> I) in Zope 2.6.1,
> 
> I.1) space separated attributes as in
> 
> <span value="value" title="title" accesskey="acc"
> i18n:attributes="value title accesskey" />
> 
> are accepted and the three attributes are translated.
> This should not work according to the ZPT i18n doc/spec at
> http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/ZPTInternationalizationSupport 
> 
> 
> I.2) semicolon separated attributes (Zope 3 current syntax) as in
> 
> <span value="value" title="title" accesskey="acc" 
> i18n:attributes="value; title; accesskey" />
> 
> are accepted.
> accesskey attribute is translated,
> value and title are kept as they are (not translated)
> and value; and title; attributes are added (HUM ;-)
> 
> IOW it doesn't work as it should according to the ZPT i18n doc/spec.

Note that the spec changed.

> I.3) attributes with associated message ids as in
> 
> <span value="value" title="title" accesskey="acc" i18n:attributes="value 
> msgvalue; title msgtitle; accesskey msgaccesskey" />
> 
> do not work.

> 
> II) in Zope 2.7.b1, and Zope3
> 
> II.1) space separated attributes as in
> 
> <span value="value" title="title" accesskey="acc" i18n:attributes="value 
> title accesskey" />
> 
> generate a compile time error
> IOW break the backwards compatibility.

Right.

> II.2) semicolon separated attributes (Zope 3 current syntax) as in
> 
> <span value="value" title="title" accesskey="acc" 
> i18n:attributes="value; title; accesskey" />
> 
> are accepted and translated correctly.
> 
> II.3) attributes with associated message ids as in
> 
> <span value="value" title="title" accesskey="acc" i18n:attributes="value 
> msgvalue; title msgtitle; accesskey msgaccesskey" />
> 
> are accepted and translated correctly according to message ids.
> 
> To summarize, as message ids translation for attributes was added, 2.7 
> and 3 are working according to the doc/spec,
> but 2.7 breaks backward compatibility to 2.6.1.
> 
> This leads to the following question : do we (1) accept this rupture in 
> i18n:attributes management or do we (2) want 2.7 to cover space 
> separated attributes ?
> 
> IOW, could people that need backward compatibility stand up ?

At the time we decided to change the spec, we looked through the plone
templates and found no case where multiple attributes in the same element
were translated.   So we judged that there was not a backward compatability
issue.

Do you know of any existing templates that translate multiple attributes in
the same element?

Jim

-- 
Jim Fulton           mailto:jim@zope.com       Python Powered!
CTO                  (703) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org