Jump to content

Smarty translation inside a foreach


devzk

Recommended Posts

Hello, I'm trying to guess how to make a translation unique inside a foreach in smarty.

 

I tried:

{foreach from=$category}
  <a href="#">{l s='%s' sprintf=$category.name}</a>
{/foreach}

And also tried:

{foreach from=$category}
  <a href="#">{l s=$category.name}</a>
{/foreach}

But any of two worked, with the first one I see just '%s' in the translation in BO, and with the second one is not even appearing in BO. I searched and I found a reference to {capture} http://www.smarty.net/docs/en/language.function.capture.tpl but I don't see the relation, because capture works with a unique name so I would be in the same trouble.

 

How can I add as a translation something like the two examples?

 

Thanks.

Edited by devzk (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...