Jump to content

Auto-select language based on browser language doesn't work with 4 digit language codes used by IE


Recommended Posts

Member eqilibrium has found a way to auto-select language for multi language shops based on browser language. A great solution! It's done by adjusting the header.tpl file: add "<% response.write(Request.ServerVariables(“HTTP_ACCEPT_LANGUAGE”))%> ' as the 3rd line. Please see this post: http://www.prestashop.com/forums/viewthread/23486/P0/general_discussion/solvedcode_for_autolanguage_selection_from_browser_for_multilanguage_sites

This works for browsers that use 2 digit language ISO codes because Prestahop uses the same. However, Internet Explorer ( from 7.0) uses 4 digit language codes like en-US for American English, or nl-NL for Dutch. Unfortunately the solution does not work in this case.

Does anybody know how to make the solution work for IE and other browsers that use 4 digit language codes?

There is another auto select solution, but that one also uses the 2 digit codes. (I've tried it with 4 digit codes, no luck). For this solution, check:
http://www.prestashop.com/forums/viewthread/20195/discussion_generale/selection_automatique_de_la_langue_suivant_langue_navigateur/

Thanks!!

Link to comment
Share on other sites

  • 4 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...