Page 1 of 1

Multilingual pages with PHP

Posted: Sun Feb 06, 2011 5:59 pm
by Sindarin
I was planning of making my CMS and frontend of a website multilingual. I've thought of using a variable in the url like &lang=en
I used a session variable to keep this setting. The header script gets the variable from the session and loads a list of constants.
Is it a good method? is there any other method? How does this affect search engines?

Re: Multilingual pages with PHP

Posted: Mon Feb 07, 2011 8:34 am
by Darhazer
do not use session - the url have to include the language. What will happen if I share the URL which do not contain the lang code. My friends will see it in the default language instead of the one we're using.
And it's not good for SEO

it's best to use URLs like domain.com/lang-code/rest-of-the-url

Re: Multilingual pages with PHP

Posted: Mon Feb 07, 2011 10:36 am
by Jonah Bron
Don't forget about $_SERVER['HTTP_ACCEPT_LANGUAGE'].

Re: Multilingual pages with PHP

Posted: Fri Mar 25, 2011 11:15 am
by Kurby
I believe Smarty is pretty good at multilingual support.

Re: Multilingual pages with PHP

Posted: Sun Mar 27, 2011 8:45 am
by MindOverBody
Use Zend_Translate