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

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}/lang.tt"; %]

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.

Hth,
Deliria.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://466456]
help
Chatterbox?
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
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?