views:

234

answers:

1

I'm trying to implements selection lists using Smarty and I'm aware of the {html_options}. The application must support localization (which I implemented as described in this post).

Is it possible to combine the two?

I'm currently handling it by parsing through the items with {section name=i loop=$list} and "manually" generating the HTML code (handling the translation with {eval}). I don't like the solution, but couldn't find a better way yet.

Many, many thanks!

+1  A: 

Write a custom Smarty plugin that calls your existing translation code.

Either a modifier that allows variables to be passed translation eg

{$myvar|translate}

Or a block function like

{translate}This text{/translate}
Hexdoll