[thelist] DBs and multi languages

Joxn joxn at vernum.com
Mon May 8 09:47:12 2000


Thanks Matt and aardvark for your replies, but my problem is a whole lot
easier, I hope.

An easy example: I want a English speaking user to select his country
when he registers.

I'd use this select box:
<select name="RE">
<option>France
<option>Germany
</select>
A German speaking user would get this one:
<select name="RE">
<option>Frankreich
<option>Deutschland
</select>

And I have _many_ such select boxes on my site. I'm not speaking about
the surrounding text, the HTML, I'm just speaking about the data that's
going to be saved in a DB (or as at the moment in a flatfile).

My question is only what's the "standard" way to store these
multilanguage data in your DB?

I was thinking of this one:
<select name="RE">
<option value=1>France
<option value=2>Germany
</select>
and
<select name="RE">
<option value=1>Frankreich
<option value=2>Deutschland
</select>

For internal usage I'd use the values 1 or 2 and when I have to output
the country I'd have to do something like this:
<pseudo-code>
if user_language equal english then print "France"
else if user_language equal deutsch then print "Frankreich"
</pseudo-code>

Again, I'm not trying to save the complete pages in a DB. I only want to
save the options in a DB because I'll need these in all the different
languages and translate them back and forth.

For example, if an English speaking user gets information about the
German speaking one, he shouldn't get the German value, but the
translated English one - and the other way round.

Am I totally on the wrong track, when I'd handle this problem this way?
Any ideas?

TIA,
Joxn
-- 
   || //\\ \\// |\\||  ::  mailto:joxn@vernum.com  ::
 \\|| \\// //\\ ||\\|  ::      ICQ:8053703         ::