fbrand Posted August 30, 2010 Share Posted August 30, 2010 Hello,I've met a problem and don't know how to resolve it. My temporary site is at http://workshop.freshbrand.lt/prestaProblem is that I've set default language Danish. And not for all users home page opens in Danish language.For example form one computer I with firefox opens Danish, But with chrome English.I want to set default Dalish language and disable language block, that main language would be Danish, but I would be able administrate it in English.Maybe someone could offer me a solution.Thank you in advance ;-) Link to comment Share on other sites More sharing options...
phrasespot Posted August 30, 2010 Share Posted August 30, 2010 I can confirm this problem, i.e. when default language is set to any language other than English in Tools >> Languages >> Language Options, and if you have English language files in place, the shop still displays in English as default. You may want to report this Link to comment Share on other sites More sharing options...
fbrand Posted August 31, 2010 Author Share Posted August 31, 2010 I think maybe I should try to remove enlgish... Collect all files... And then rename all from en to eng an try to install then. Then maybe the main Language would be Danish. Link to comment Share on other sites More sharing options...
phrasespot Posted August 31, 2010 Share Posted August 31, 2010 Default language setting is not what it seems to be apparently. See this bug report. To workaround your problem, you can get your server to strip Accept-Language headers. Then whatever you set in back office Tools >> Languages >> Language Options, it will be the default language served to visitors. Link to comment Share on other sites More sharing options...
Balkon Posted September 1, 2010 Share Posted September 1, 2010 Very annoying bug. How can I strip those headers ? Can it be done in Cpanel ? Link to comment Share on other sites More sharing options...
fbrand Posted September 1, 2010 Author Share Posted September 1, 2010 One of my friends, said that it should be resolved with JAVAscript and coockies. We will try. And I let you know. Link to comment Share on other sites More sharing options...
phrasespot Posted September 1, 2010 Share Posted September 1, 2010 (edited) This, arguably, seen as a feature (see the bug report) by some. How it works is: For visitors with no previous cookie the language matching the Accept-Language header is served. If the visitor changes the language then this preference is saved in the cookie and the language that matches the one encoded in the cookie is preferred over Accept-Language header and served in subsequent visits. If neither a cookie nor Accept-Language header exist, then the default language is served. In summary, this is the current situation Cookie Accept-Language Language served No No default No Yes Accept-Language Yes No cookie Yes Yes cookie In practise this means, the default language is only served to robots (or if the visitor sent header coincidences with the default language setting). First time visitors and privacy conscious (due to clearing cookies, and more and more nowadays) will see whatever their browser sends as Accept-Language header. The problem with that is, as I said before, the "Default Language" setting is not what it seems to be; if I set the default language to be, say German, I expect visitors who did not explicitly change their language to another one, and preserved that with a cookie, to see German UI. I am pro-choice and IMHO, the best thing would be to let the shop owner decide what language will be served, as implied by the "Default Language" setting, e.g. say, by providing a checkbox for "Ignore Accept-Language headers" within the Language options. Short of that, one can remove the Accept-Language from the request headers by adding a .htaccess file with the following stanza (or appending it to an existing .htaccess), assuming Apache Headers module is installed # Remove Accept-Language header (if exists) to really serve # the "default language" set, for visitors without a cookie RequestHeader unset Accept-Language Then the above will table will transform to following: Cookie Language served Yes cookie No default Edited May 26, 2012 by phrasespot (see edit history) 2 Link to comment Share on other sites More sharing options...
merinoexperten Posted September 9, 2010 Share Posted September 9, 2010 Sorry but exactly where is this .htaccess file placed?ThanksPeter Link to comment Share on other sites More sharing options...
phrasespot Posted September 10, 2010 Share Posted September 10, 2010 to the root public directory, where e.g. robots.txt would go, prestashop's index.php or 404.php files are, though be careful, do not overwrite an existing one, and you can make your site inaccessible with a faulty .htaccess. Link to comment Share on other sites More sharing options...
merinoexperten Posted September 11, 2010 Share Posted September 11, 2010 I still can't get it to work:My website is at www.merinoexperten.se/test I have tried to add the code above both in the folder under /test and I also tried to add it in the existing htaccess file in merinoexperten.se/What am i doing wrong? Can my hosting cause a problem? Link to comment Share on other sites More sharing options...
idared Posted September 13, 2010 Share Posted September 13, 2010 phrasespot, thank you, thank you, thank you, the solution worked (adding your snippet to htaccess) on my shop. Link to comment Share on other sites More sharing options...
n00kie Posted December 12, 2010 Share Posted December 12, 2010 RequestHeader unset Accept-Language I created an account just to thank you. So thank you!Your solution worked flawlessly. Link to comment Share on other sites More sharing options...
Arieswe Posted February 10, 2011 Share Posted February 10, 2011 I have had the same problem. Prestashop standard Englisch en default Dutch.Within firefox (english) version the shop is switching to english. I have not configured the shop in english and i want my shop only in the dutch language.What did i do??Go to AdminToolsLanguagesDisable English (not delete).And firefox is working with the dutch language. 1 Link to comment Share on other sites More sharing options...
ai.farfa Posted March 29, 2011 Share Posted March 29, 2011 This, arguably, seen as a feature (see the bug report) by some. How it works is:In summary, this is the current situation[pre]Cookie Accept-Language Language servedNo No defaultNo Yes Accept-LanguageYes No cookieYes Yes cookie[/pre]assuming Apache Headers module is installed# Remove Accept-Language header (if exists) to really serve # the "default language" set, for visitors without a cookie RequestHeader unset Accept-Language Then the above will table will transform to following:[pre]Cookie Language servedYes cookieNo default[/pre] this explain the situation very clearly. solved!! Link to comment Share on other sites More sharing options...
alchemisto Posted June 9, 2011 Share Posted June 9, 2011 It's not working for me.I've added those htaccess lines in my root .htaccess file, but website still have different default language when accessed with different browser.Chrome & Safari will have website opened in English, while the other browsers will open the website in the correct default language as set in back office.Is there any different method to fix this issue? Link to comment Share on other sites More sharing options...
electron Posted September 5, 2011 Share Posted September 5, 2011 Thanks phrasespot you saved my day ! Link to comment Share on other sites More sharing options...
TWDesign Posted July 11, 2012 Share Posted July 11, 2012 (edited) I've been doing some testing in different browsers and here are the results I am seeing (vers 1.4.7.0) In Google Chrome (and presumably Safari, since they are both Webkit), PrestaShop remembers the last language preference selected by the user on the next subsequent visit. (First time visitors always see the DEFAULT language, set in the BO, regardless of browser language preferences). Firefox/Opera on the other hand, do not. They ALWAYS serve up the default language for the site. Site language preference cookies & browser language preferences appear to make not a iota of difference. In the case of Firefox (and Opera may well be the same) this behaviour appears to be due to the use of DNS caching on my local hardware. DNS caching is a relatively recent "feature" of Firefox to speed up performance but it DOES cause some headache for developers/designers IMHO. Which is why you can test my comments above by downloading a Firefox addon which flushes your DNS cache. https://addons.mozil...on/dns-flusher/ Edited July 12, 2012 by TWDesign (see edit history) Link to comment Share on other sites More sharing options...
www.bio-krby-kamna.cz Posted October 23, 2012 Share Posted October 23, 2012 Hi members. I have same problem. I try change .htacces and add RequestHeader unset Accept-Language and got error Internal server error. What wrong? See: # .htaccess automaticaly generated by PrestaShop e-commerce open-source solution # http://www.prestashop.com - http://www.prestashop.com/forums # URL rewriting module activation RewriteEngine on # URL rewriting rules RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/p/$1-$2$3.jpg [QSA,L,E] RewriteRule ^([0-9]+)\-([0-9]+)/([_a-zA-Z0-9-]*)\.jpg$ /img/p/$1-$2.jpg [QSA,L,E] RewriteRule ^([0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/c/$1$2.jpg [QSA,L,E] RewriteRule ^lang-([a-z]{2})/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$3&isolang=$1$5 [QSA,L,E] RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2&isolang=$1$4 [QSA,L,E] RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$2&isolang=$1 [QSA,L,E] RewriteRule ^([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2$4 [QSA,L,E] RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$1$3 [QSA,L,E] RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$1 [QSA,L,E] RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /cms.php?id_cms=$1 [QSA,L,E] RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*)(.*)$ /supplier.php?id_supplier=$1$3 [QSA,L,E] RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*)(.*)$ /manufacturer.php?id_manufacturer=$1$3 [QSA,L,E] RewriteRule ^lang-([a-z]{2})/(.*)$ /$2?isolang=$1 [QSA,L,E] # Catch 404 errors ErrorDocument 404 /404.php # Remove Accept-Language header (if exists) to really serve # the "default language" set, for visitors without a cookie RequestHeader unset Accept-Language Link to comment Share on other sites More sharing options...
badsanta Posted December 11, 2012 Share Posted December 11, 2012 Bio-krby-kamna, try to check if Appache Headers module is installed. If it does not, request your host provider to install it. 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