On 04/07/2011 03:42 AM, Clément OUDOT wrote:

> We develop a special filter, called translate_template, that allows to
> define<lang>  markup in the template with translations. When the
> filter run, it only keep the translation of the user language. With
> this, we have internationalized templates.

We actually do something very similar in the Krang project. i18n is 
accomplished with <tmpl_lang> tags like so:

   <tmpl_lang Please press the button>

And the preprocessor will translate that into all of the supported 
languages and then it saves those translated templates to the file system.

> Maybe we can try to include this feature in H::T core module?

Honestly I don't think it's the right place. As you can see from my 
explanation above, there are lots of ways to do i18n. Also, as you can 
see we didn't want to take the hit at runtime so we pre-translate all 
templates at application startup and thus don't have to ever do it again 
until something changes and we then have to restart.

I could see releasing either your filter approach, or the approach by 
Krang as separate modules onto CPAN, but not general enough for H::T

-- 
Michael Peters
Plus Three, LP

------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Html-template-users mailing list
Html-template-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/html-template-users

Reply via email to