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

Philipp von Weitershausen philipp at weitershausen.de
Mon Aug 18 16:07:34 EDT 2003


Shane Hathaway wrote:
> Philipp von Weitershausen wrote:
> 
>>   <browser:editform
>>       schema="some.schema"
>>       name="edit"
>>       label="This form label shall be translated"
>>       menu="some_menu_id"
>>       title="This menu title shall be translated"
>>       />
> 
> 
> Ok, I see what you mean.
> 
> I might want to write the above directive this way:
> 
>  <browser:editform name="edit">
>    <schema src="some.schema"/>

Now, that's too much. This works equally well:

<browser:editform
     name="edit"
     schema="some.schema>

>    <label msgid="my-form-msg-id" text="Default form label"/>
>    <menu id="menu_id" msgid="my-menu-msg-id" text="Default menu title"/>

I have to say I like that better

>  </browser:editform>
> 
> This introduces the following rules:
> 
> - Every i18n-aware string in ZCML files should be contained in an 
> attribute called "text".  All message IDs should be in an attribute 
> called "msgid".  This makes it easy to write a tool that scans for 
> translatable strings in ZCML.

This means you're turning nearly every attribute into subelements. That 
makes it harder for the machinery to figure out what needs to be passed 
to the directive handler. Same applies for schema definitions.

> Incidentally, another rule I'm introducing is that all Python dotted 
> names should use the same XML attribute, "src".  This will make it 
> easier to recognize and find dotted names.

You're basically introducing new semantics with some strong rules like 
special namings of attributes. I'm not sure I like that.

> In general, I want ZCML to be more modular.  I don't know how well the 
> current ZCML machinery would support this, but I'd rather ignore 
> implementation issues for now.

You would have to define 'modular' a bit more. ZCML can be fairly well 
extended with new schema fields. There are complex directives that have 
subdirectives; even new metadirectives can be defined, as the 
zope.configuration.backward module demonstrates.

Making the semeanics you suggested above work would require some 
modification to the xmlconfig machinery, though.

Philipp




More information about the Zope3-dev mailing list