DEV Community

Cover image for IP-based localization, why oh why?
Rémy 🤖
Rémy 🤖

Posted on

IP-based localization, why oh why?

HTTP is a smart protocol and many headers help the browser to negotiate the content with the server. In particular, there is Accept-Language that allows to list the user's languages by order of priority and it's a perfect way to determine in which language you are going to display your website to the user.

Yet, as I travel(ed) a lot, I notice that a lot of websites actually will serve you content based on your IP address and the language that they guess is associated to it. That is not very noticeable when I go to countries that speak languages I speak but when I go to Czech Republic the Internet becomes suddenly much less usable to me.

And this seems utterly stupid to me:

  • If the browser is telling you via Accept-Language why would you trust it less than a guesstimate based on the user's IP address' supposed location?
  • You can more or less pin an IP address to a country but you can rarely pin a country to a language. France, Spain, India, Canada, the US, and so forth have several languages spoken on their territory and often officially. Sometimes there's not even common languages between all the people of the country. It's not the exception, it's the rule. Hence when doing IP-based localization you're naturally offending a lot of people.

Now, I understand that some websites like e-commerces have a complicated localization process since a lot more things will depend on the country rather than the language (available products, shipping costs, etc).

But if your website exists in several languages, why oh why would you enforce one language on the user based on their IP's country?

Top comments (0)