[geeklog-devel] Question about internationalization and look-ups

Joe Mucchiello joe at ThrowingDice.com
Fri Feb 8 15:10:37 EST 2008


At 02:35 PM 2/8/2008, Tony Bibbs wrote:
>I'm at a point where I've got some internationalization problems 
>that would make people like Dirk cringe.

Well, Dirk (or someone else) solved this problem with the Language 
arrays that mirror the drop down tables. COM_optionList in lib-common.php.

>Two problems:
>1) Values in the drop down come from the database in English only

Why? Internationalize the database. Make the table be LISTNAME, 
VALUE, DESCRIPTION, LANGUAGE and then require LISTNAME and LANGUAGE 
in the query. If the query comes back empty, default to the system's 
default language.

>2) the '-- Select Type --' is meant to be the first option in the drop-down.

Put an ORDERBY field in the above table. This way if the fields are 
('temperature', 'cold', 'cold', 'en', 1), ('temperature', 'hot', 
'hot', 'en', 2) in English, they can be ('temperature', 'cold', 
'froid', 'fr','2),('temperature','hot','chaud',1) in French and the 
order by keeps the words in alphabetical order.

SELECT value, description FROM listofeverything WHERE listname = 
'temperature' AND language = 'en' ORDER BY orderby

>Any suggestions on how to elegantly fix these problem?

Elegant? You're talking about natural language semantics. There's 
nothing elegant about that. :-)


----
Joe Mucchiello
Throwing Dice Games
http://www.throwingdice.com 




More information about the geeklog-devel mailing list