louissss Posted March 25, 2014 Share Posted March 25, 2014 Hi I have 2 languages on my prestashop 1.5.3 website, English and French. I would like to always display the front office in English (wherever the user is from) and let the user the possibilty to switch to French if he really wants it. Can you help me figure ou thow to force English in Front office ? Thanks Link to comment Share on other sites More sharing options...
El Patron Posted March 25, 2014 Share Posted March 25, 2014 because lang browser detection not 'really' working until 1.5.6, then visitors without previous history will be shown shop default lang. is you shop default language English? Link to comment Share on other sites More sharing options...
louissss Posted March 25, 2014 Author Share Posted March 25, 2014 (edited) Sorry, I didn't know where to set it but I just found it : localization>localization Yes it is now And it is working as expected thanks for your help Edited March 25, 2014 by louissss (see edit history) 1 Link to comment Share on other sites More sharing options...
louissss Posted March 28, 2014 Author Share Posted March 28, 2014 Sorry I think I talked too quickly...my prefered language is set to english, but the Front Office is still in French....do you know what can I do ? Link to comment Share on other sites More sharing options...
El Patron Posted March 28, 2014 Share Posted March 28, 2014 Sorry I think I talked too quickly...my prefered language is set to english, but the Front Office is still in French....do you know what can I do ? What is your front office shop url? Link to comment Share on other sites More sharing options...
louissss Posted March 28, 2014 Author Share Posted March 28, 2014 (edited) it is http://eurosurfimport.com/ Edited March 28, 2014 by louissss (see edit history) Link to comment Share on other sites More sharing options...
El Patron Posted March 28, 2014 Share Posted March 28, 2014 I just visited your shop and see default of English. This can be for two reasons: 1. your last visit to the shop, you used French, this is recorded in browse cookie and will be used next time your visit shop. Clear cookie. (but this may still display French, see 2) 2. your browsers (ff/explorer/etc) primary language is French, and no previous cookie will set shop language to French. If your primary browser language is French, and you want to see your shop in English (and no previous cookie), then set your browse language to English. Link to comment Share on other sites More sharing options...
louissss Posted March 28, 2014 Author Share Posted March 28, 2014 Ok thanks Is there a way to display the shop in English, independently from the user's browser language ? Link to comment Share on other sites More sharing options...
El Patron Posted March 28, 2014 Share Posted March 28, 2014 I extended existing PrestaShop browser language detection. Please see my latest work for PrestaShop language localization. [Module] Geo Localization - Advanced Browser Language Detect Link to comment Share on other sites More sharing options...
andy_alex Posted October 3, 2014 Share Posted October 3, 2014 Hi louissss, After I have struggled with this problem, I found a way to stop Prestashop 1.6.0.9 from automatic language detection and change to browser selected language. This helped me to stop Location Detection & Redirect users to their browser language automatically. First back-up the files: Cookie.php and Tools.php 1. Modify site/classes/Cookie.php >> on line 307 $this->detect_language = true; with $this->detect_language = false; 2. Modify site/classes/Tools.php >> on line 350 and at the end of the line 368 add /* */ /* Automatically detect language if not already defined, detect_language is set in Cookie::update */ /* if ((!$cookie->id_lang || isset($cookie->detect_language)) && isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { $array = explode(',', Tools::strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE'])); $string = $array[0]; if (Validate::isLanguageCode($string)) { $lang = Language::getLanguageByIETFCode($string); if (Validate::isLoadedObject($lang) && $lang->active && $lang->isAssociatedToShop()) { Context::getContext()->language = $lang; $cookie->id_lang = (int)$lang->id; } } } if (isset($cookie->detect_language)) unset($cookie->detect_language); */ I haven't tested it very intensively, but it seems to work. PS: Don't forget to change default language in Prestashop BO to your desired language and delete browser cookies. 1 Link to comment Share on other sites More sharing options...
El Patron Posted October 3, 2016 Share Posted October 3, 2016 Hi louissss, After I have struggled with this problem, I found a way to stop Prestashop 1.6.0.9 from automatic language detection and change to browser selected language. This helped me to stop Location Detection & Redirect users to their browser language automatically. First back-up the files: Cookie.php and Tools.php 1. Modify site/classes/Cookie.php >> on line 307 $this->detect_language = true; with $this->detect_language = false; 2. Modify site/classes/Tools.php >> on line 350 and at the end of the line 368 add /* */ /* Automatically detect language if not already defined, detect_language is set in Cookie::update */ /* if ((!$cookie->id_lang || isset($cookie->detect_language)) && isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { $array = explode(',', Tools::strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE'])); $string = $array[0]; if (Validate::isLanguageCode($string)) { $lang = Language::getLanguageByIETFCode($string); if (Validate::isLoadedObject($lang) && $lang->active && $lang->isAssociatedToShop()) { Context::getContext()->language = $lang; $cookie->id_lang = (int)$lang->id; } } } if (isset($cookie->detect_language)) unset($cookie->detect_language); */ I haven't tested it very intensively, but it seems to work. PS: Don't forget to change default language in Prestashop BO to your desired language and delete browser cookies. why would one every do this? if visitor has language preference then serve them, this just breaks the concept of visitor localization, is a step back not forward. Link to comment Share on other sites More sharing options...
Recommended Posts