Page 1 of 1

how to add multi language facility in a website?

Posted: Wed Jan 06, 2010 4:39 am
by eshban
Hi,

I am working on a custom CMS based website. I need to add a multi language facility in this website. Means the same website will be available in these languages i.e. English, German, Swedish, Arabic, French, Dutch. I do not want to make 6 different websites for each language.

What are the best techniques to implement this task. I am using PHP with Mysql.


Looking forward for your replies.

Thanks

Re: how to add multi language facility in a website?

Posted: Wed Jan 06, 2010 10:02 am
by pickle
Make 6 copies of the website content. Make a `en_content`, `de_content`, `fr_content`, etc (or whatever your tables are called). When the user accesses your page, determine what language they want, then pull your content from the appropriate tables.

Re: how to add multi language facility in a website?

Posted: Wed Jan 06, 2010 10:02 am
by rhecker
The way I have done it is to use sessions to pass the language variable from page to page. So once the visitor selects a language, the variable $language is set to something like _ger for German. Then this drives whic content is delivered to the pages. Each row of the table in the database contains separate columns for each language, like so title_eng title_ger. If the sessions variable is set to _ger, then title_ger gets called, and so forth.

I created a cms backend so the translators could directly edit the page content for the language(s) they were responsible for, showing the English on one panel and the other language in a parallel panel.