Thanks heaps Kornel.
Can I extend this with variable substitution of the href attribute? As:

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

??

-Alister

2009/8/18 Kornel Lesiński <kor...@aardvarkmedia.co.uk>

> 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
> PHPTAL@lists.motion-twin.com
> http://lists.motion-twin.com/mailman/listinfo/phptal
>



-- 
Alister Cameron
Managing Director
Cameron Creative Pty Ltd
www.cameroncreative.com

Creative, Strategic, Innovative... never boring!
_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to