Why are still a lot of websites setting language based on IP detection instead of browser headers etc.?

Basically, subj.

I’m just completely annoyed as I setup my browser to request en-us, and still a lot of websites (including Google sometimes) are still showing me the localized version based on my IP address, whyyyyyyy

Completely cursed websites are not even allowing me to switch version and force-redirecting me to the version with wrong language.

As web developers, can we stop doing this? Literally, can you check that behavior on the project you’re working on and make a ticket/bug-report if ip-detected localization have bigger priority over user’s browser settings?

Noticed the same thing a couple of days ago. We use a company VPN which is located in Sweden and it’s pia I tell ya. Luckily, I recently implemented a change on our website to respect headers.

But yea, just because you are visiting Japan doesn’t mean that everything has to be Japanese

Logic we use for language selection is

  1. Language user picked last time stored in cookie/ account settings if there is one.

  2. Language requested by browser header or a close match if it’s available, ie a request for en-ca or en-gb will give you en-us rather than falling into option 3. This is the bit a lot of sites forget to handle.

  3. Language based on ip address if it’s available.

  4. English if all else fails, for when a new user is in Japan but we only have translations available for European languages etc.

Default currency selection is handled separately from language as well. That’s based on last currency used, then location based on ip, then default to USD.

when google does it, it’s always german when i have my german VPN on (it’s fine bc i can speak german), but it’s sometimes inconsistent and doesn’t translate a lot of things which is stupid

Had to deal with this problem several times and most of the time is because of cost and legal reasons.

Multimarket websites may deliver different content(not just translations) based on user location, this is done because legal reasons. What if you want to see Canada market in Hindi? Then content team has to translate both Canada market content and Indian market. This adds more complexity.

Not saying there aren’t ways to do this right. But then tech team has to educate 3 departments why url structure needs to be in a certain way and also get approval for more resources because everything needs to be translated into everything.

Also, stripe serving me German payement providers with no way to select anything else and I have to VPN to another IP in the same country to get local payment providers. Just stop using geoip for critical features, it doesn’t work!

Browsers may default to requesting a particular language depending on the operating system’s locale, and/or they may allow the user to configure it, but they also might not, as a privacy measure.

You see, your particular combination of request headers (browser version, accepted media types, accepted languages, and others) is surprisingly unique, and setting the language preference, especially if you have multiple weighted accepted languages, makes it even more so. That can make it pretty easy to track users.

That’s why some browsers won’t even send out the preferred languages. See this article from the Brave browser for more detail.

Even when browsers are willing to send a user-configured accept-language header, very very few people know how to configure it, or that they even can.

So if some browsers don’t send the header, or always send the same value, and if basically nobody even knows how to customize it even when their browser is willing to send it, websites can’t exactly rely on it as an indicator of the user’s preferred language. And so in many cases it’s better to use the user’s rough location as a starting point, and then remember a preference via localstorage or a cookie if the user then uses the language switcher.

I’d say it’s because not everyone who develop or setup a website know everything or always make the best decisions.

I mean, there are even experienced actual developers that think localization is hard, and it’s not like you need a license or certificate to setup a website.

As expat, this drives me nuts.

Thank you for bringing this to my attention. I’ll def try to do that one day as I was also doing it by IP.

IMHO websites should have their default language and let people choose the language they’d like to use. I hate whenever I’m looking for English content and yet the results come in Spanish(my main language). If I wanted to browse Spanish websites I’d be googling stuff in Spanish. This shit happens to me a lot when googling " {anime name} wiki) and the first results are Spanish ones and not English ones.

I also have a similar issue with websites that force a black theme on you. Just because I’ve set my O.S to use dark mode doesn’t mean I want to browse your website on dark mode too.

Gmail is the worst: https://i.imgur.com/wD03fJ4.jpg

Good luck switching that to English. No language icon, tiny changer tucked away.

It’s even worse when they get even that wrong. I live in Belgium where the majority speaks Dutch, I live in the Dutch speaking part, my IP will show the same, and yet some websites consistently serve me their French language site

I’ve written some guidelines for developers who want to be smart about languages for their websites: https://www.linkedin.com/pulse/building-multilingual-website-antony-meyn/

Why? Legacy. That’s why. Someone did it this way, and it’ll be a few years before someone steps in to change it.

New projects are moving that way, but the old stuff takes a lot more to change.

Dude…

I approved a PR yesterday removing a perfectly working language switcher. Why? Because ‘we have no requirement for that’. So our app is in the language of your phone OS or browser and that’s that.

You suggest devs create tickets for it? Yeah might work in small companies or startups, but in my world requirements are set by departments I don’t even have access to and they dont give a shit about UX.

I think it’s often a matter of language being tied to the business type of thing. Imagine a webshop, which serves different items and features based on the country. If they have enough money like Amazon they can serve those, with the language of your choice, but often it’s easier to tie them together.

It would help if people were more aware of this header. Not my first time hearing about it, but I’ve seen more people excited about geolocation. Geolocation is hotter than headers.

Content-Language needs some love.

Product teams often create features and requirements, and many orgs might like staff and principle engineers to fight against poor features and requirements- while your juniors and seniors are probably just going to try to ship as many features and requirements as they can

No idea, I didn’t made them. I also didn;'t know you can do that from header.

Write greasemonkey script that automatically chooses other language.

I didn’t bothered, because not that many sites actually do that. And google asks only once and saves that to cookie. I only ever seen that message again when used different browser, I even forgot it’s a thing.