[Zope3-dev] Re: idea: attr:foo addition to tal

Philipp von Weitershausen philipp at weitershausen.de
Fri Jul 23 07:38:01 EDT 2004


Godefroid Chapelle wrote:

> Philipp von Weitershausen wrote:
> 
>> It could even combine in the following way:
>>
>> <input type="submit"
>>        attr:value="here/label"
>>        i18nattr:value="button-label" />
>>
>> where button-label is the message id.
> 
>  >
>  > +1 from me for SteveA's idea!
>  >
>  > Philipp
>  >
> 
> I think the exemple hereabove does not make sense.

You are right, of course ;).

> If attr:value is used, it is to be dynamically generated; this implies 
> that it should not be translated by a static message (iow no static 
> message id).
> 
> 
> To go on for brainstorming, lets sum up.
> 
> <input type="submit"
>        attr:value="here/label" />
> 
> is very readable when generating an attribute.
> 
> <input type="submit"
>        i18nattr:value="button-label" />
> 
> is also readable when inserting one of x translations of a static message.

Yup.

> But what about the situation currently expressed as the following :
> 
> <input type="submit"
>        tal:attributes="value here/label"
>        i18n:attributes="value" />
> 
> where we want to state that the dynamically generated value needs to be 
> translated.
> 
> The more generic our framework will be, the more often this situation 
> will appear.
> 
> A first alternative would be :
> 
> <input type="submit"
>        attr:value="here/label"
>        i18n:attributes="value" />
> 
> I think that this is already a step further.
> 
> A second alternative could be :
> 
> <input type="submit"
>        attr:value="here/label"
>        i18nattr:value="" />
> 
> I must say I dislike empty attributes that are supposed to mean sthing !

We have it now with i18n:translate in the exact same way... I know, that 
doesn't mean you have to like it ;)

In the end, we should settle for *One Way To Do It*. That means, if we 
were to adopt Steve's suggestion, we should think about doing away with 
tal:attributes and i18n:attributes for the long term... I'll rather have 
consistency, even if the price is empty attributes ;)

Philipp



More information about the Zope3-dev mailing list