[Templates] Localization Approach using TT
Fagyal Csongor
concept@conceptonline.hu
Thu, 04 May 2006 12:58:00 +0200
Hi,
>> 2. Could someone give me some examples of how
>> localization is used with templates TT2-ish way(any
>> documents or open source projects that use TT and
>> localization) or any pointers on this.
>
>
> (shameless plug) have a look at Template::Multilingual on CPAN.
I have a home-grown solution created for our "TT2 based" application
server (just a framework with FCGI binding, actually), which uses
pre-parsing. It uses the usual key=>text mapping, like:
xxx.tem: ( <= this is the template )
...
{{main_title}}
...
xxx.lang: ( <= this is the language file )
...
main_title:This is the main title
**
...
The good thing is that preparsing is taking place before TT2 actually
compiles the template, so there is no overhead.
The bad thing is that it does not make too much sense to use our (GNU)
module standalone, but as a part of the whole framework (where it is
only a parameter in the config file).
- Fagzal