Re: [PHP-I18N] Multilingual Web application - how to?

[email protected] (Ligaya Turmelle)
Newsgroups php.general,php.i18n
Message-ID <[email protected]>
I am currently am using the IntSmarty extension to Smarty (you can get 
it and more information at 
http://www.coggeshall.org/oss/intsmarty/index.php/7/).  With it the 
translation(s) is stored as a flat file rather then a DB so it is easy 
to pass along to the translators and load.  I personally find it simple 
to use and if the page is in the utf8 character set, capable of any 
language (I have English and 2 Asian Languages).  As for the current 
language variable - it automagically loads the browsers current language 
from the preferences. Let me know if you would be interested in it (I 
have a _slightly_ hacked version to work with the utf8 character set 
rather then the latin character sets).

other options I know of - gettext, PEAR has a couple of classes for 
translations, and I also believe that there are a couple of classes at 
phpclasses.org.

Denis Gerasimov wrote:
> Hello list,
> 
> I need to develop a multilingual web site and I am looking for the best way
> of handling this task. There are three main issues I know:
> 
> 1. Storing multilingual data in a database. Possible solutions I know:
> a. many tables, one per each supported language, e.g. news_en, news_de.
> b. one table having many columns with translations, e.g. (id, date, text_en,
> text_de)
> We use MySQL 4.1 as a back-end.
> 
> 2. Multilingual HTML templates, possible solutions:
> a. one generic template for everything, one per each language, like
> contents_en.tpl.html, contents_de.tpl.html
> b. many localized templates for each page, e.g news_en.tpl.html,
> news_de.tpl.html
> Template engine is Smarty.
> 
> 3. Storing current language variable, possible solutions:
> a. inside the URL like /en/news/
> b. using cookies
> c. using sessions
> Web server is Apache2+mod_rewrite with PHP5
> 
> What are pros and cons for each solution? What are other possible solutions
> for the above issues?
> 
> Best regards, Denis Gerasimov
> Outsourcing Services Manager,
> VEKOS, Ltd.
> www.vekos.ru
> 

-- 
Respectfully,
Ligaya Turmelle

"Life is a game.... so have fun"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.