On 18-08-2009 at 08:25:32 Alister Cameron <alister.came...@cameroncreative.com> wrote:

I have this string as the translation key:
You must be <a href="path/goes/here" title="Log in">logged in</a> to post a comment.

Two issues with it...

1. I want the href to be a variable.
2. I want the HTML retained.

To replace the variable I could use the i18n:attributes="href /path/to/var"
approach, but I assume that is incompatible with the fact that the string
itself is up for translation. How do I do that then??

Try this:

<div i18n:translate="structure">You must be <a i18n:name="loginlink" href="path/goes/here" title="Log in"><span i18n:translate="">logged in</span></a> to post a comment.</div>

Outer i18n:translate will translate "You must be ${loginlink} to post a comment", i18n:name will ensure link is placed in appropriate place and inner i18n:translate will translate link label (PHPTAL doesn't allow i18n:translate and name on same element, that's why there's <span>.)

regards, Kornel

PHPTAL mailing list

Reply via email to