Re: Re: Setting i18n:domain to a variable
Josef Meile <[email protected]> Fri, 24 Nov 2006 12:56:11 +0100
| Newsgroups | gmane.comp.web.zope.page-templates |
|---|---|
| Message-ID | <[email protected]> |
>> <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