[ILUG-BOM] How to design multilingual website

Kenneth Gonsalves lawgon@[EMAIL-PROTECTED]
Tue Sep 19 12:14:17 IST 2006


On 19-Sep-06, at 11:44 AM, Philip Tellis wrote:

>> yes. One is the strings used in the code - just make a  
>> standard .po file and you are done. Translating the content - all  
>> my content is stored in database tables. I create fresh tables for  
>> each language - the headache is to get people to translate, so  
>> this has not been implemented as yet
>
> do you do run time string replacement or do you maintain separate  
> copies of html files for each language?  the former is non- 
> performant, the latter is a maintenance nightmare unless you have a  
> single source of truth that's compiled to each language version

string replacement is handled by python's gettext module so it is  
runtime replacement from the compiled .mo file. All content is pulled  
from the database, so, for example, I have a table like this:

create table article(
id    serial  primary key,
title varchar(100)
...
matter text
)

then the language tables:

create table langarticle(
id serial primary key,
art_id foreignkey to article(id)
lang_id foreigngkey to languages(id)
title - varchar(100)
matter - text
)

and depending on the language setting, the appropriate file is pulled  
out of the database and sent to the template


-- 
regards

Kenneth Gonsalves
Associate, NRC-FOSS
lawgon at au-kbc.org
http://nrcfosshelpline.in/web/






More information about the Linuxers mailing list