views:

255

answers:

2

I am currently developing a multi-language site using Zend Framework.

The system will pick a language for the user when he enters our site. If he doesn't like the language chosen by our system, he can choose another language.

What is the best way to remember which language the user is chosen?

+1  A: 

User preferences if he has a profile on the site, session & cookie otherwise.

Bonus: are you using the Accept-Language HTTP Header to determine a new user's preferred language ?

streetpc
+4  A: 

As stated below; use sessions and cookies first then revert back to guessing the users preferred language. If the user has a login, store the information in the database attached to the user. A language Id maybe.

Add language checking code that checks settings in this order:

user profile(DB) session cookies approximate

On manual change, update all levels e.g. db, session and cookies.

Derek Organ
Best to not use things like 'As stated above' in your answer since once your answer get's up-voted (like it has now) it moves to the top of the list. Probably better to say 'As mentioned by XXuser'.
Wally Lawless
yea, noticed that alright. noted.
Derek Organ