in reply to Template::Toolkit, look-and-feel and internationalization
We set up the language translation recently with TT -- here's how we did it (I'm not by any means claiming this is _THE_ way to do it.. not good or bad, just A way) (also, this wasn't too exciting because it was just for english-US vs english-UK):
- Went through all the templates and wrapped all the text in a FILTER tag. So from: <div>Hello</div> to: <div>[% FILTER localize %]Hello[% END %]</div>
- localize is setup in our custom TT modules. It bascially takes the text and treats it as a primary key. It gets the current locale from httpd.conf. Now, if it can find in a database table a value for that pk for that locale, it uses that. Otherwise it just returns the original text.
- Had to populate these new locale tables with some translations.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Template::Toolkit, look-and-feel and internationalization
by lachoy (Parson) on Jun 13, 2005 at 20:01 UTC | |
by davidrw (Prior) on Jun 14, 2005 at 00:13 UTC | |
by ruoso (Curate) on Jun 14, 2005 at 11:54 UTC | |
by deliria (Chaplain) on Jun 14, 2005 at 13:21 UTC | |
by lachoy (Parson) on Jun 14, 2005 at 01:23 UTC |
In Section
Seekers of Perl Wisdom