[orm-devel] How to handle multi language?

Werner F. Bruhin werner.bruhin at free.fr
Fri Jun 17 12:10:03 CEST 2005


Hi All,

My application supports multiple languages (en, de, fr), my current 
implementation works but I think there is "space for improvement" and I 
am looking for some hints/suggestions on how to do this.

Currently the "multi lang" table have a structure similar to this:
ID, LANGID, NAME

Which would have entries like this for a country table:
1, 1, Germany
1, 2, Deutschland
1, 3, Allemagne
etc etc

When user selects his/her language I create a "single lang" table from 
the "multi lang" one, e.g. if selected "en" I would get a table with 
just the English language entries (in above sample with LANGID = 1).

One additional thing I did is that if one selected e.g. "de" (in above 
sample with LANGID = 2) and a particular record did NOT have a German 
translation I would copy the english translation into the single lang table.

This all works but it means maintaining additional tables and worse 
makes it impossible for one user selecting German and the other user on 
the same system using English.

So, I am looking for ideas on how I could do this just having the 
multiple language tables and allowing each user to select his/her language.

Thanks in advance for any ideas and/or hints.
Werner



More information about the orm-devel mailing list