NYCPHP Meetup

NYPHP.org

[nycphp-talk] multilingual strategies

Chris Snyder csnyder at chxo.com
Wed Dec 3 21:04:57 EST 2003


Marc Antony Vose wrote:

> How do you handle multilingual sites?  Do you tend to store data in 
> text files, in a database, or some other way?  Do you maintain 
> different entire databases for each language, or different tables in 
> the same database, or just different columns in the same table(s)?
>
I'm currently a fan of creating records in a separate table, one for 
each translation of a document. The translations table is keyed on the 
document id and language code so there can't be multiple same-language 
translations of something.

On lookup, if the user's language is different from the document's 
language, some logic handles the lookup and, if a record is found, the 
original content is replaced with the translated content.

One suggestion: consider using valid locales as your language codes so 
that you can use them with strftime() to format dates. Just using "en" 
or "es" might not be enough depending on your OS.

    csnyder




More information about the talk mailing list