Here's the solution I applied to this program in a project of mine.

In my templates, I prefix my tokens with lang_. 
e.g.: <TMPL_VAR lang_address>, <TMPL_VAR lang_real_name>, etc...

Then, I overloaded HTML::Template and used my own new method to which, on
top of the usual HTML::Template parameters, I pass the language I want to
use.

In there, I loop through each template parameter, and if it starts with
lang_, I look up the proper value in a dictionary system of my own.

I also use the same functionality for capitalizing tokens. In that case, I
suffix the tokens with _caps.

That way, I can have only one template, and the graphic people can't really
mess it up :)

Hope that helps,

Fred Hurtubise

-----Message d'origine-----
I can't imagine how to use it, how to enclose string in template file
and how to call gettext() function (this has to be called from within 
HTML::Template code).

I think ability to write templates in several languages is common
requirement, so common that built-in support in templating engine should 
be considered. 




-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
Html-template-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/html-template-users

Reply via email to