Hi Henrique

Thanks for your reply, but ...

Use tal:attributes to set the values:

<h2 tal:define="statusMessage python:request.get('statusMessage');
                   domain python:request.get('domain')"
       tal:attributes="i18n:domain domain;
                       i18n:translate string:">someText</h2>
it doesn't work either. Have you tested this? Anyway, I reduced the case to this:

  <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>

With the browser's language set to german and calling the template like this: http://myurl/zptTemplate?domain=JMMessages

I get:

Ungültige Auswahl
Wrong selection

So, the alternative you propose didn't execute the i18n directives, but they are rendered in the html, which isn't really desired. This is what you get when looking at the html source:

    <h2>Ungültige Auswahl</h2>
    <h2 i18n:domain="JMMessages" i18n:translate="">Wrong selection</h2>


So, I guess the "tal:attributes" directive only makes sense for real html attributes and not for zpt directives (somebody correct me if I'm wrong).

ZPT mailing list

Reply via email to