Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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

by deliria (Chaplain)
on Jun 14, 2005 at 10:13 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2024-03-29 11:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found