Jump to content

Recommended Posts

Hello All,

 

 

I have a store in 3 language (English, french, Spanish).

I want set user country based default languages.

 

If any visitor/customer comes from French then shop default language must set to french.

And If any visitor/customer comes from Spanish then shop default language must set to Spanish.

And for rest others default shop language must be English.

 

 

I am trying to changes in cookie class files. but exactly not getting what to change.

So please help me what to do and how to do.

 

 

Link to comment
Share on other sites

As far as my short experience with prestashop, I think that it detects automatically the language according to the language of the browser used!

here is the link how to do that.

 

https://github.com/PrestaShop/PrestaShop/pull/178

 

But you have to set a default language in case the language of your visitor isn't provided  in your case you want English and that can be done in the BO, go to localization tab -> localization -> configuration

there you can set the default language!

Edited by walidon (see edit history)
  • Like 1
Link to comment
Share on other sites

Dear friend,

 

I will try to explain to you in détails:

 

Your shop is in 3 lgges; English, Spanish and French.

 

If a visitor from France comes to your shop and he is using an operating system in french language (whether Windows, Mac, Linux, Tablette, Ipads or any device working with an operating system) and his browser too is in french; then your shop automatically detects the french language and provides to that visitor the french version of your site.

let say that someone from any other country in the world using the same configuration as your french visitor (the french languae in his device) then he as well will get your french version of the site.

the same applies to the Spanish language, where the Spanish version of your site will be given to those visitors who al configurations are in spanish language.

 

Now lets say that a visitor who has chinese, japanese , portugese, arabic, italian or any language apart from French and Spanish come to visit your shop, then the English version will be given to them.

 

But if you assign IPs, then lets say that someone from France comes, he will be served french language, but what about other countries who use french as their language too? the same applies to spanish.

 

Hope you got the idea.

 

Sorry I can't help you more in this:) as I don't know the answer.

Edited by walidon (see edit history)
  • Like 1
Link to comment
Share on other sites

ok, But when I changed my browser language to french and then open site, it still loading in English (English is selected as default)

don't know why?

 

did you clear your browser cookies?  PS cookie remembers the last language selected so you must clear the cookie.

Link to comment
Share on other sites

  • 2 months later...

Hello I'm interested in this thread, do you mean that prestashop sets language depending of the browser language??? I have my browser in english and it shows my shop in Spanish which is my default language.... Is there any special configuration to get browser's language in prestashop?

 

Thanks for your help.

Link to comment
Share on other sites

Hello I'm interested in this thread, do you mean that prestashop sets language depending of the browser language??? I have my browser in english and it shows my shop in Spanish which is my default language.... Is there any special configuration to get browser's language in prestashop?

 

Thanks for your help.

 

Please post front office url and your prestashop version.

 

ps supports browse lang  detect in 1.5.6 and above.

Link to comment
Share on other sites

  • 4 months later...

Just a follow up to this.

 

you do not want to use Geo Localization, geolitecity.dat file is only around 85% accurate, the other 15% will be forbidden (native PrestaShop behavior) to shop.  So don't use.

 

While browser detection in 1.5.6 and higher was a good move, it does not support scenario of 'I prefer Danish, but will accept the following language) in HTTP_ACCEPT_LANGUAGE.  In other words native PrestaShop will look at first language in HTTP_ACCEPT_LANGUAGE but if not defined in shop, use default without looking for other visitor browser languages.

 

Localization has always been of interest to me and important for my customers.

 

Here is the most advanced language detector, on the planet.

[Module] Geo Localization - Advanced Browser Language Detect
Link to comment
Share on other sites

×
×
  • Create New...