I'm wondering if there is a proper solution to a common problem: 
translating a page template with dynamic attributes. If I put something 

    <p i18n:translate="">
      Hi, please <a tal:attributes="href view/click_url">click</a> here!

in a page template, this wouldn't be translated properly, cause it ends 
in a msgid like

    msgid="Hi, please <a href=\"${DYNAMIC_CONTENT}\">click</a> here!"

Therefore I end up writing

    <p tal:content="structure view/renderLink"></p>

    class MyView:

        def renderLink(self):
            return _('Hi, please <a href="${href}">click</a> here!',
                mapping={'href': self.click_url()}

to get a msgid that reads

    msgid="Hi, please <a href=\"${href}\">click</a> here!"

Isn't there a way to express the same in the PT alone? Or should the 
first example do the trick, and it should be considered a bug that it 

Thanks, Sascha

Lalisio GmbH                                          www.lalisio.com

Puschkinstraße 1                             fon +49-(0)361/541 43 80
99084 Erfurt                                 fax +49-(0)361/541 43 79
                                                 [EMAIL PROTECTED]
Zope3-users mailing list

Reply via email to