PrestaShop/PrestaShop — pull request #176 by nsorosac (2013-01-14 14:27:55+00:00)
Title: Detect default language

The default language detection from Tools::setCookieLanguage is never processed because Cookie::$id_lang is populated before this method is called.

To allow automatic language detection base on the client HTTP headers, I moved the language detection code from Tools::setCookieLanguage to Cookie::update.

To test this feature : access the base URL of a multilingual PrestaShop 1.5.3.1 ; without language suffix, and let the default language redirection happen: without this fix, PS_LANG_DEFAULT is always used. With this fix, the browser language is used (fallback = default language).