Cata100 Posted October 3, 2016 Share Posted October 3, 2016 (edited) Hello, I am still struggle with the default language problem in Prestashop 1.5.6 - the website is http://www.minimecraft.ro , the default language is romanian, (http://www.minimecraft.ro/ro is the romanian site, and www.minimecraft.ro/en - the enlglish version) - now the romanian language is set as default but in some browsers firefox, edge etc. if the browser's language is english...the default URL http://www.minimecraft.ro it is set to romanian and it points to the english version by default, it go to http://www.minimecraft.ro but it shwows the english version ( - in presta , at localization/configuration, everything is set in romanian - see attachment - i cannot disable the english version at all because all the links will be broken - please help me with a fix for this problem Thank you! Catalin Edited October 3, 2016 by Cata100 (see edit history) Link to comment Share on other sites More sharing options...
Daniel Patilea Posted October 3, 2016 Share Posted October 3, 2016 Hello, I am still struggle with the default language problem in Prestashop 1.5.6 - the website is http://www.minimecraft.ro , the default language is romanian, (http://www.minimecraft.ro/ro is the romanian site, and www.minimecraft.ro/en - the enlglish version) - now the romanian language is set as default but in some browsers firefox, edge etc. if the browser's language is english...the default URL http://www.minimecraft.ro eben it is set to romanian , will go to english - in presta , at localization/configuration, everything is set in romanian - see attachment - i cannot disable the english version at all because all the links will be broken - please help me with a fix for this problem Thank you! Catalin Go to Localization > Localization and check the "Set language from browser" option Link to comment Share on other sites More sharing options...
Daniel Patilea Posted October 3, 2016 Share Posted October 3, 2016 Go to Localization > Localization and check the "Set language from browser" option Sorry, I see that you are using PS 1.5. Check this post Link to comment Share on other sites More sharing options...
El Patron Posted October 3, 2016 Share Posted October 3, 2016 this is normal behavior and best practice to enable detect language from visitor http. That's what it is supposed to do..... Link to comment Share on other sites More sharing options...
Cata100 Posted October 3, 2016 Author Share Posted October 3, 2016 Thnak you El Patron for the fast reply, well then it is not a bug, i can see that it is a normal behavior, but help me please to be abnormal How can i do to set the default language as romanian, and whatever is the browser, device etc. to go to the romanian language when they reach the homepage of the website http://www.minimecraft.ro for some website in 1.6 i could see that they are able to redirect the homepage to websitename.ro/ro (and if i am doing the redirect from / to minimecraft.ro/ro i am getting errors) i need a solution for this situation Thank you, Cata Link to comment Share on other sites More sharing options...
El Patron Posted October 3, 2016 Share Posted October 3, 2016 gosh it's been long time since I worked on 1.5...getting old and forgetful You will need to modify classes/cookie.php find $this->detect_language = true change to $this->detect_language = false because there is no 'clear cache' button in your old school release then you will need to rename or delete the file, rename is safer for most people. cache/class_index.php rename or delete will force to ps to rebuild class cache. Link to comment Share on other sites More sharing options...
Cata100 Posted October 3, 2016 Author Share Posted October 3, 2016 El Patron, thank you for the solution proposed, i was able to change that parameter in cookie.php , //checks if the language exists, if not choose the default language if (!$this->_standalone && !Language::getLanguage((int)$this->id_lang)) { $this->id_lang = Configuration::get('PS_LANG_DEFAULT'); // set detect_language to force going through Tools::setCookieLanguage to figure out browser lang $this->detect_language = false; - i have also renamed cache/class_index.php which, indeed it was better to rename it because a new one was generated automatticaly but as far i can see the situation is the same (Note: i have erased individual cookies from my firefox browser too, and also tried in incognito/private mode) is something that i did wrong? do i have to do soemthing else in addition? or any other recommendations are welcome Thank you, Cata Link to comment Share on other sites More sharing options...
El Patron Posted October 3, 2016 Share Posted October 3, 2016 hey great job you broke the www.... personal message me with access to back office....today later I can log in and see your shop config, not to save time, provide ftp access... thanks, el Link to comment Share on other sites More sharing options...
El Patron Posted October 5, 2016 Share Posted October 5, 2016 Modified classes/Tools.php @line 345 //ensure autodetect does not fire... if (isset($cookie->detect_language)) //elpatron unset($cookie->detect_language); //elpatron now working as desired.... Link to comment Share on other sites More sharing options...
Cata100 Posted October 5, 2016 Author Share Posted October 5, 2016 Hello El Patron, - thanks a lot for the help, it works like a charm, yes indeed it is working as i desired - my browser from android it still shows the english version perhaps it remained in cache but the rest of them chrome, firefox, edge is showing the right language Thank you again, Cata p.s i don't know how to close this topic Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now