andenand Posted March 24, 2014 Share Posted March 24, 2014 Hello Prestashop 1.6.0.5: (Fresh install) I cant change the default language as its (of course) is not possible to delete or inactivate the default language.I have installed a new language, but there is no option here to choose it as default language - neither there on in the language menu. Thus I cannot inactive or delete english and choose a new language as default. Am I missing something? Great system btw! Link to comment Share on other sites More sharing options...
vekia Posted March 24, 2014 Share Posted March 24, 2014 Hello Prestashop 1.6.0.5: (Fresh install) I cant change the default language as its (of course) is not possible to delete or inactivate the default language. I have installed a new language, but there is no option here to choose it as default language - neither there on in the language menu. Thus I cannot inactive or delete english and choose a new language as default. Am I missing something? Great system btw! open this tab in your back office: localization > localization Link to comment Share on other sites More sharing options...
andenand Posted March 24, 2014 Author Share Posted March 24, 2014 Great - thanks that did fix it! I´ll mark the tread as solved. Link to comment Share on other sites More sharing options...
vekia Posted March 24, 2014 Share Posted March 24, 2014 you're welcome topic title marked as solved. with regards, Milos Link to comment Share on other sites More sharing options...
prerana Posted July 4, 2014 Share Posted July 4, 2014 Hi, I'm new to prestashop & i am using prestahop_1.6.0.8 & I expect my shop in french. I have even set the default language to french in the dashboard/back office. But It aint working. Please help. I have attached the screenshots below. Link to comment Share on other sites More sharing options...
vekia Posted July 4, 2014 Share Posted July 4, 2014 hello perhaps your browser use english language and while you open your shop it is in english. clear shop cache, clear browser cache and check your front office. also try with different browsers where default language (in browser) is different. Link to comment Share on other sites More sharing options...
rfourt Posted July 28, 2014 Share Posted July 28, 2014 How can i force the visitors to see my preferred language "SWEDISH" even though they are using an english Browser/OS just like myself are using.Many people in sweden are using english browsers. 1 Link to comment Share on other sites More sharing options...
vekia Posted July 29, 2014 Share Posted July 29, 2014 you marked "SE" language as default language in your store? Link to comment Share on other sites More sharing options...
rfourt Posted July 29, 2014 Share Posted July 29, 2014 Thank you for answer.yes, SE is marked.But when clearing cache and entering site with a english browser the language is english. 1 Link to comment Share on other sites More sharing options...
vekia Posted July 29, 2014 Share Posted July 29, 2014 and if you enter with browser where language is different? for example swedish, you still see english language? Link to comment Share on other sites More sharing options...
mhandzhiev Posted August 1, 2014 Share Posted August 1, 2014 I have the same issue. I want the shop to be in MyLanguage the first time they open it .. not in English. Is there a coding way to do that ? Link to comment Share on other sites More sharing options...
rv01 Posted August 6, 2014 Share Posted August 6, 2014 Same for me: "FR" is the default language When I try to access "naturelore.com" using incognito mode with Chrome : it leads to naturelore.com/en/ How to change that so that it goes to .../fr/ ??? Thanks Link to comment Share on other sites More sharing options...
El Patron Posted August 6, 2014 Share Posted August 6, 2014 Same for me: "FR" is the default language When I try to access "naturelore.com" using incognito mode with Chrome : it leads to naturelore.com/en/ How to change that so that it goes to .../fr/ ??? Thanks Howdy, I set my default language browser to French, visited your shop and it defaulted to French. TIP: PrestaShop will detect browser language and if present in shop, use that language. So change your 'first' choice of browser language to French, clear cookies for that domain, re-visit. Link to comment Share on other sites More sharing options...
rv01 Posted August 6, 2014 Share Posted August 6, 2014 Hi, Thanks, Yes I know. Are you sure that all French will see the website in French first? I was astonished that with incognito mode I was geared to .../en/ , why? Another question: ....com is redirected to ....com/fr it seems to be bad for webmaster tools, is it? 1 Link to comment Share on other sites More sharing options...
El Patron Posted August 6, 2014 Share Posted August 6, 2014 Hi, Thanks, Yes I know. Are you sure that all French will see the website in French first? I was astonished that with incognito mode I was geared to .../en/ , why? Another question: ....com is redirected to ....com/fr it seems to be bad for webmaster tools, is it? hi, I don't know incognito. I can't say about redirect. you may want to post new forum topic Link to comment Share on other sites More sharing options...
rv01 Posted August 6, 2014 Share Posted August 6, 2014 "incognito" just means you browse without sticking history and cookies, nothing mysterious. incognito is a good way to see your website responding to google search, otherwise google is pleasing you in putting you on first page, but it's fake and only for you !!! With Chrome you press "cmd+shift+N" (on a Mac) and there you are. 1 Link to comment Share on other sites More sharing options...
rfourt Posted August 7, 2014 Share Posted August 7, 2014 So the question still is.Is there a way to bypass the default function from Prestashop which detects the visitors browser language.?I want to force my visitors to always see Swedish language even though they are using, whatever language in there browsers. Although they should have the option to choose "English" or any other language in the dropdown.Like myself i never use Swedish browser even though i am swedish and live in sweden. 1 Link to comment Share on other sites More sharing options...
rv01 Posted August 7, 2014 Share Posted August 7, 2014 (edited) So the question still is. Is there a way to bypass the default function from Prestashop which detects the visitors browser language.? I want to force my visitors to always see Swedish language even though they are using, whatever language in there browsers. Although they should have the option to choose "English" or any other language in the dropdown. Like myself i never use Swedish browser even though i am swedish and live in sweden. You can try this, it's a bit wild ... : edit the file: yourwebsite/classes/Guest.php (take a safe copy first) For Prestashop 1.6.0.8 (I haven't checked for the other versions) line 79: $acceptLanguage = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : ''; ==> replace by $acceptLanguage = 'xx'; // xx being your Swedish language code line 95: $langsArray[$lang] = 1; ==> replace by $langsArray[$lang] = n; // n being the language ID number given by Prestashop, for Swedish Don't forget this change will be erased each time you update to a new release of Prestashop. Note: this does not change the language cookie which is managed in .../classes/Tools.php line 333... so this is valid for a new guest or one having cleared his cookies. i.e.: if a guest change the language he will still be directed to this language thereafter. Good luck. Edited August 7, 2014 by rv01 (see edit history) 1 Link to comment Share on other sites More sharing options...
rv01 Posted August 7, 2014 Share Posted August 7, 2014 Thanks rfourt There are some little side effects after these modifications I made today: - cannot change the BO language, always in the default language, bizarre - it may change the behaviour of modules using directly the browser language. To be checked, waiting your results. René Link to comment Share on other sites More sharing options...
rv01 Posted August 7, 2014 Share Posted August 7, 2014 Hi Fred, Agree with you about modifs to the core, but hey ;-) When you have a wedsite targeting non EN language this subject is hot because most people use their browser in english, and as your website is optimized for say FR, you want guests to be welcome in FR first. After that if they change language they will stick to it. My modifs lead to this behaviour, will see if there is no other annoying side effect like the language in the BO. Cheers René Link to comment Share on other sites More sharing options...
El Patron Posted August 7, 2014 Share Posted August 7, 2014 Hi Fred, Agree with you about modifs to the core, but hey ;-) When you have a wedsite targeting non EN language this subject is hot because most people use their browser in english, and as your website is optimized for say FR, you want guests to be welcome in FR first. After that if they change language they will stick to it. My modifs lead to this behaviour, will see if there is no other annoying side effect like the language in the BO. Cheers René Your point is very valuable, i.e.there are many with different requirements by community. I have to write for general community who read later so that they know what if any issues may happen. suerte. I am kicking around a some new development in this arena. 1 Link to comment Share on other sites More sharing options...
rfourt Posted August 8, 2014 Share Posted August 8, 2014 Thnx again..And "El Patron" you bring out a important thing there about SEO.But as i said most people i know use a browser in English even if they are from Sweden or Turkey, but in my line of business for what im selling my customers would feel alot safer if the site is presented directly in swedish as most of my customers are over the age of 40 i think many would feel insecure if the first page is presented in English.But lets say i use a English browser and i only have Swedish and Norwegian language installed i guess its going to pic Swedish if i have set that to default language even though i enter with an English browser.? Link to comment Share on other sites More sharing options...
andy_alex Posted October 3, 2014 Share Posted October 3, 2014 Hi rfourt, 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. 5 Link to comment Share on other sites More sharing options...
mojweb Posted October 31, 2014 Share Posted October 31, 2014 Any update on this? rfourt, you solve your problem? This is big problem for all non english countries. Anyone checked andy_alex code? Link to comment Share on other sites More sharing options...
torayeff Posted November 2, 2014 Share Posted November 2, 2014 Any update on this? rfourt, you solve your problem? This is big problem for all non english countries. Anyone checked andy_alex code? I have checked and it works Link to comment Share on other sites More sharing options...
mojweb Posted November 2, 2014 Share Posted November 2, 2014 I have successfuly implemented solution by andy_alex. It seams to work ok. For now, this is the best solution. tnx andy! But this is core hack and at next update may not work. Is there solution to solve this with override? 1 Link to comment Share on other sites More sharing options...
vekia Posted November 2, 2014 Share Posted November 2, 2014 you can create override of class with modifications proposed by andy_alex it will work :-) 1 Link to comment Share on other sites More sharing options...
mojweb Posted November 2, 2014 Share Posted November 2, 2014 Great vekia. I didnt know for class overrides. Sometimes is good to read developers manual first Link to comment Share on other sites More sharing options...
cycleelcyc Posted December 25, 2014 Share Posted December 25, 2014 works like a charm Merry X'mas :-) Link to comment Share on other sites More sharing options...
El Patron Posted January 20, 2015 Share Posted January 20, 2015 in 1.6.0.11 there is new option back office-->localization-->localization-->scroll down you will see Set language from browser-->set this to 'No' for earlier versions you can use posts above. Link to comment Share on other sites More sharing options...
tomes Posted February 5, 2015 Share Posted February 5, 2015 Admin language change still dosn´t work in 1.6.0.11. I changed it in localization, but no luck. So, I need to change it by andy-alex method? Is it working with 1.6.0.11? I just installed it today. Link to comment Share on other sites More sharing options...
parry27j Posted February 7, 2015 Share Posted February 7, 2015 hi dear I am facing the same problem with my prestashop 1.6.0.11 I have installed prestashop in English language might be not sure but now I am using other account web linker software with my prestashop in Spanish language and want to change my installed prestashop language in Spanish. is it possible to change the language permanently. can anyone help me for this matter. waiting for reply Link to comment Share on other sites More sharing options...
Recommended Posts