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

Re: Writing multilingual perl applications?

by iguanodon (Priest)
on Mar 20, 2003 at 03:10 UTC ( #244521=note: print w/ replies, xml ) Need Help??


in reply to Writing multilingual perl applications?

Where I work, we do this by storing the localized messages in a database. We have a module that provides a method to fetch a message for the current user's preferred language, substituting place holders for non-translatable parts of the message. So all the print statements or template-fillers in our applications look like

get_localized_messsage($app_id, $lang_id, 35, 'Joe Customer', 3);

which would return 'Welcome back, Joe Customer. It's been 3 days since you visited our site.' provided that message number 35 (in English) for this application is 'Welcome back, {0}. It's been {1} days since you visited our site.'. The place holders can be moved around by the translators to accommodate the syntax of different languages.


Comment on Re: Writing multilingual perl applications?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2015-07-30 00:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls