Monday, March 30, 2009

i18n in the LAMP stack

i18n should be done server side.

There are 3 main options for organizing the database schema:
1. Separate column for each language
2. Translation table with columns for each language
3. Translation tables with rows for each language
(http://stackoverflow.com/questions/316780/schema-for-a-multilanguage-database)

3 looks to be the most versatile, but 2 is feasible since if requirements are relatively simple.

Mysql will need to be configured to save the data in unicode
http://www.vitzo.com/en/article/quick-guide-to-internationalization-i18n-using-php-and-mysql
http://www.tanzilo.com/2008/10/13/php-mysql-unicode-solution-to-chinese-russian-or-any-language/


Best practices
http://stackoverflow.com/questions/155719/best-practices-for-internationalizing-web-applications