[ZPT] Re: Setting i18n:domain to a variable
Josef Meile
jmeile at hotmail.com
Fri Nov 24 06:56:11 EST 2006
>> <html>
>> <body tal:omit-tag=""
>> tal:define="domain python:request.get('domain','JMGui')">
>> <div tal:replace="domain"/>
>> <h2 i18n:domain="JMMessages" i18n:translate="">Wrong selection</h2>
>> <h2 tal:attributes="i18n:domain domain;
>> i18n:translate string:">Wrong selection</h2>
>> </body>
>> </html>
>
> I think if you find yourself needing to do something like this, your
> application logic is flawed.
>
> i18n:domain should never need to be dynamic in this fashion...
The problem is that I have a Product that lists instances of other
products in a combobox like this:
http://myurl/ConfiguratorJM/CreateJMProduct?objectType=JMPeople
http://myurl/ConfiguratorJM/CreateJMProduct?objectType=JMCompany
This will render a page like this:
Person : <ComboBox containing object titles + url> <SubmitButton:
Edit><SubmitButton: Delete>
When the user edits a person or a company, then a form with all fields
will be presented. After he
is finished, he will go back to that form and a status message will be
presented. This status message
won't belong always to the same domain; that's why I wanted to do it
that manner. Anyway, I guess
the only way is to translate the message programatically instead.
Regards
Josef
More information about the ZPT
mailing list