Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Multi-language web app

by Tanktalus (Canon)
on Jan 23, 2006 at 17:31 UTC ( [id://524983]=note: print w/replies, xml ) Need Help??


in reply to Multi-language web app

Where do you store your text now? If, as I would hope, you have your text in templates (whether using Text Template, HTML::Template, or another similar solution), those templates are going to be stored either on disk or in a database. If it's in a database, simply add a new column for language (I suggest using ISO-standard language identifiers, either 2-letter (en), or 4-letter-with-middle-underscore (en_US), or 4-letter-with-middle-underscore-dot-encoding-name (en_US.iso88591)). If it's on disk, then use the language identifier as a directory name instead.

Also, don't forget that if a particular template is not found in the location you want, you need to be able to fall back to a reasonable default. e.g., if the desired files aren't found, and your default language is English, then fall back to English. If it's not there, then you have real problems ;-)

I've always noticed that it's easier to design this in from the ground up than it is to add in after the fact.

Replies are listed 'Best First'.
Re^2: Multi-language web app
by diego_de_lima (Beadle) on Jan 23, 2006 at 18:29 UTC
    Well, thanks for the advices, it's getting clear to me.

    In fact, despite this is a web app, it's much more a software than a web page. So, the templates are quite similiar to each other (think of phpPgAdmin, it's very similar to that).

    More details:
    - I'm using a homemade MVC framework, very similar to Catalyst. But I want to have just ONE view/template to ALL supported languages in one page - the templates/views are quite complex, with lots os javascript, DHTML, Ajax...
    - The software is an ERP solution. So I don't care that much on beauty, but more on usability.
    - I have a 10 Gb PostgeSQL database behind it, 500 tables using one single template for browsing, other for details, etc... So, you see, this template must be quite complex to handle so many different field types.
    - I use BerkeleyDB with MLDBM to cache lots of user information, like passwords, and some postgres schema information, and it's doing a good/fast job on that (but I acsess it only a few times per request, not dozen of times like it would happen with a lang dictionary).
    - This time I'm not worryed about translating this 10 Gb DB :)
    - I'm worried about translating simple software messages like: "Please enter your username and password", "The required field %s is blank", etc...

    Yes I've seen linux gettext and I thought that's a good way too. Do you know if it's faster than BerkeleyDB?

    Thanks,

    Diego de Lima

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2024-04-18 10:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found