[Zope3-dev] Re: i18n domains vs. unique message ids -OR- whyShakespearean English was better

Shane Hathaway shane at zope.com
Mon Aug 18 15:43:05 EDT 2003


Philipp von Weitershausen wrote:
> What if there is more than just the 'title' attribute that is to be 
> translated?

Well, that would be quite a surprise to me.  In my universe, permissions 
are so simple that only the 'title' attribute will be presented to the 
user.  Developers might want to see the raw permission ID sometimes.

> Also, attributes in ZCML elements are defined through a 
> schema. The schema fields handle the conversion. So when you say 
> <browser:editform schema="somemodule.myinterface" />, the GlobalObject 
> field, which is used for the 'schema' attribute, will resolve that 
> string and return it.
> All lookup functionality is contained in the field. No change would have 
> to be done to the configuration machinery, the MessageID field would 
> simply know how to parse something like "[View]

But you're adding more syntax, when XML already provides the 
extensibility you need.  It sounds like ZCML is oversimplifying.

> Martijn Faassen and Godefroid Chapelle are currently arguing on IRC, 
> that an XML namespace like i18n (as known in ZPTs) should be used.
> 
>   <permission id="zope.View" i18n:attributes="title" title="View" />
> 
> Stephan Richter and I basically vote against this as
> 
> 1.) Namespaces have a different meaning in ZCML than in ZPT. In ZPT, 
> they 'hide' tal, metal and i18n commands from the xhtml namespace and 
> they are meant to be used as attributes. In ZCML, we use namespaces to 
> indicate different configuration domains, like 'zope', 'browser', 
> 'meta', etc.
> 
> 2.) Supporting this ZPT-like i18n namespace in ZCML would require 
> extensive changes to the ZCML XML machinery. One could argue that it 
> doesn't belong there. As stated above, schema fields contain all the 
> logic that is necessary to resolve the data provided in the XML 
> attribute. They are self-contained, so to speak.
> 
> 3.) Not every attribute would be allowed to be translated. In the above 
> example, the 'id' attribute would not be allowed, because it's a global 
> identifier. How would ZCML know that? Maybe only allow MessageID fields 
> to be translated? Well, why not put that funcationally into the 
> MessageID field in the first place...?
> 
> What are your opinions on this?

You're right that you can't expect ZCML to understand arbitrary i18n 
attributes.  It doesn't make sense at that level.

Shane




More information about the Zope3-dev mailing list