[ZPT] Re: [Zip] Coming changes in page templates
Florent Guillaume
fg@nuxeo.com
Sat, 29 Mar 2003 00:24:35 +0100
+1 from me.
The transition will be quite easy as it's very simple to audit the code
for uses that would fail:
find . -name '*.pt' -print0 | xargs -0 grep 'i18n:attributes="[^"]* '
For example current Plone only has one, and our internal code only has a
few occurences.
Florent
In article <16004.40197.387420.472922@grendel.zope.com> you write:
>
> Message IDs and i18n:attributes:
> --------------------------------
>
> We're planning on changing the TAL i18n:attributes syntax to add
> support for explicit message IDs.
>
> This change is not completely compatible with the existing behavior,
> but is necessary. We don't expect it to actually break anyone's
> templates, but wanted to give a "heads up" just in case. For
> templates which only use i18n:attributes to flag one attribute for
> translation at a time (i18n:attributes="foo"), there will be no
> change.
>
> The current i18n:attributes definition states:
>
> This attribute will allow us to translate attributes of HTML tags,
> such as the alt attribute in the img tag. The i18n:attributes
> attribute specifies a list of attributes to be translated; if
> multiple attribute names are given, they must be separated by
> spaces.
>
> This will change in the following ways:
>
> 1. Semi-colons will be used to separate attributes.
>
> 2. Attribute names may be followed by an explicit message ID,
> separated from the ID by whitespace. The message ID may not
> contain spaces.
>
> For example:
>
> <input type="submit"
> value="Delete"
> i18n:attributes="value menu-delete-button-label" />
>
> means:
>
> Look up a translation for the message id
> menu-delete-button-label. If you find one, change the value of the
> value attribute to the translation, otherwise, leave it alone.
>
> Templates that specify two or more attributes to translate will see
> one of two failure modes. In the case of exactly two attributes (in
> the old syntax), the result will be that the first will be translated
> using the name of the second as the message ID. This will yield
> unexpected results, but not an error. In the case of more than two
> attributes, an error will be raised when the template is compiled.
>
> Please send comments on this change to the ZPT list.
--
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87 http://nuxeo.com mailto:fg@nuxeo.com