[orm-devel] How to handle multi language?

Werner F. Bruhin werner.bruhin at free.fr
Tue Jun 21 13:18:58 CEST 2005


Hi Diedrich,

Diedrich Vorberg wrote:

> Hi Werner!
>
>> All your suggestions got me thinking.  Whenever you or anyone else  
>> has a moment to look at the attached, I would be greatful for  
>> comments/critics - this is nothing urgent.
>> Any hints, comments, critic (but be nice, please!) is very welcome
>
> Thank you very much for sharing your ideas with the list!
>
> I'd like to make two remarks, though:
>
> 1. I don't think it is a good idea to have several rows per language  
> in the same table. This is going to make SELECT queries less streight  
> forward, because you always have to exclude those entries you don't  
> want for the current language. (If the parent table is the only one  
> you do SELECTs on that's not a problem, of course).

All the "multi language" tables are what I call master data (Stamm 
Daten) type tables, they don't change much and they are not that often 
used in SELECT queries except in cases to fill e.g. a combobox but in 
that case I have to select the appropriate language anyhow, so I either 
do a SELECT with a where clause or decide which column to use.

> Anyway, I'd like  to have one row per country, though dispite the face 
> that there are  three country names, it's only one country.

You are right there should only be one row per thing (country in this 
case), I am not really happy with my solution nor with your's, so it is 
probably back to the drawing board.

I use gettext for the program labels, maybe one could base it on their 
approach. 

The text to translate becomes the "ID" to find the translation, i.e. 
have a column type "TRANSLATE" which does a lookup in a table containing 
translations if the language ID is found for the "ID" that entry is used 
otherwise the "ID" is used.

>
> 2. Just a small one: I think lang_2oneColumn can be optimized by  
> using a JOIN so you don't need to run two queries.
>
> Have a nice weekend!
> Diedrich
>
Hope you had a nice weekend, here it was a bit too hot for my taste but 
very nice evenings.

See you
Werner




More information about the orm-devel mailing list