Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Template::Toolkit, look-and-feel and internationalization

by deliria (Chaplain)
on Jun 14, 2005 at 10:13 UTC ( #466456=note: print w/replies, xml ) Need Help??

in reply to Template::Toolkit, look-and-feel and internationalization

In our app we take the language preferences of a user from his settings, cookie or guess it based on his browser headings or failing all, guess his language by his IP. In the head of .tt's we PROCESS the proper language template which holds the translations by key:

The template inclusion is done via a:
[%- PROCESS "locale/${user.lang}/"; %]

The language files look like:
[% lang.label.status = "Status"; .... lang.phrase.sure = "Are you sure"; %]

and a tag is simply called using:
[% lang.label.status %]

This method also allows you to send the collection of language templates to a translator without you having to import anything to a database or whatnot.

Regarding custom skins, have a looksee at Plesk and see how much they do with stylesheets. It's very nifty.


Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://466456]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2021-11-29 06:02 GMT
Find Nodes?
    Voting Booth?

    No recent polls found