Hi, What do you mean by all-whitespace translation keys? I hope that doesn't mean i18n:translate="" will stop working, because we rely heavily on this feature ;-)
On 11/23/09, Kornel Lesiński <kor...@aardvarkmedia.co.uk> wrote: > On 22.11.2009, at 20:16, lo...@nic.fi wrote: > >> I'v got a problem translating text that is printed dynamically from a >> mysql database. I'm printing body part names and the related muscle names >> by using nested tal:repeat. In the inner loop I'd like to echo the muscle >> name and translate it if there's a translation available. Here's what I >> got so far: >> >> <ul> >> <li tal:repeat="bodyPart bodyParts"> >> <tal:block tal:content="bodyPart/name" /> >> <ul> >> <li tal:repeat="muscle php:bodyPart.Muscles"> >> <tal:block i18n:translate=""> >> <span tal:content="muscle/name" /> >> </tal:block> >> </li> >> </ul> >> </li> >> </ul> >> >> .. but all that the inner loop prints is empty li elements. What am I >> doing wrong? > > Use this instead: > >> <tal:block i18n:translate="muscle/name"> > > > i18n:translate="" builds translation key at compile time, ignoring tags and > dynamic content. > > i18n:translate="expression" will use value of the expression as translation > key. > > > I've changed PHPTAL to reject all-whitespace translation keys. Version in > SVN will now prevent this gotcha. > > -- > regards, Kornel > > > > > _______________________________________________ > PHPTAL mailing list > PHPTAL@lists.motion-twin.com > http://lists.motion-twin.com/mailman/listinfo/phptal > -- -- Tjerk _______________________________________________ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal