Why do websites now prefer IP-based geolocation rather than the `Accept-Language` HTTP header?
from undefined@lemmy.hogru.ch to nostupidquestions@lemmy.world on 12 Jun 04:53
https://lemmy.hogru.ch/post/1864658

As an avid VPN user it’s infuriating that multilingual websites insist on using the client’s IP address to determine their language and country when web browsers have been sending the Accept-Language HTTP header since the mid-90s.

I understand that you can work out more or less where someone is located based on their IP address but it was never meant to be a geo-based marker. Why not go the simple route and use the header?

#nostupidquestions

threaded - newest

muntedcrocodile@hilariouschaos.com on 12 Jun 05:07 next collapse

I would assume because ur hitting the geolocated cache which will be IP based. I would assume its not doing a location check its simply that the site is being served by the nearest (IP routing wise) provider and that cache is configured to serve only the local language. Its the same reason the language is often encoded in the URL.

undefined@lemmy.hogru.ch on 12 Jun 05:10 collapse

Excellent point on the local cache explanation! I hadn’t thought of that.

As a web developer myself I’m into detecting it automatically then redirecting to a URL that includes it (like /en/products). Then of course users can manually change it by signing in and/or using cookies.

Acamon@lemmy.world on 12 Jun 06:20 collapse

You’re doing the Lord’s work. As someone who lives in a country where I can barely speak the language this is a constant frustration.

I also hate how hard it is to override location for other searches. I travel back and forth to my native country regularly, and so I’m often trying to search stuff or buy things for a different country than the one I’m literally in. If Google is so keen on making money from me, why can’t I tell it to do a Product search in a specific country, instead of forcing me to use a vpn to trick it?

undefined@lemmy.hogru.ch on 12 Jun 06:27 collapse

The country-based shopping dilemma sounds tough to solve without a VPN. I think the explanation there is that because countries have different laws they might not be legally allowed to show some products.

entwine413@lemm.ee on 12 Jun 05:07 next collapse

Probably because it’s easier to track people that way.

undefined@lemmy.hogru.ch on 12 Jun 05:12 collapse

Sure, but that could be decoupled from language/regional preferences.

When I travel to another country my smartphone doesn’t change its language to match that of the host country, so why don’t websites respect the user-defined preference defined in the header?

Jeeve65@ttrpg.network on 12 Jun 08:14 next collapse

It was not that long ago when Android changed my on screen keyboard to a different layout whenever I was in a different country. Really annoying - I don’t suddenly type in Danish when I’m on a business trip to Lyngby (near Copenhagen)

IsThisAnAI@lemmy.world on 12 Jun 09:03 collapse

No one is spending money to cater to a miniscule audience.

undefined@lemmy.hogru.ch on 12 Jun 15:10 collapse

Doesn’t it cost less money to parse the header than to pay for an entire geolocation dataset?

dysprosium@lemmy.dbzer0.com on 12 Jun 05:32 next collapse

I’ve been complaining about this for years. And since the large influx of vpn use (esp US I think), I expected this to become a more pressing and widespread issue, leading to more urgency to fix it. But no, even google sites seem to not give a shit IIRC

undefined@lemmy.hogru.ch on 12 Jun 05:37 collapse

As a user it’s annoying because I have to hunt down the language/region settings. And as a developer it would cost me a lot more to hunt down those values based on the client IP address.

lepinkainen@lemmy.world on 12 Jun 05:42 next collapse

Especially bad for counties with multiple official languages, they just pick one at random

undefined@lemmy.hogru.ch on 12 Jun 05:44 collapse

I’ve noticed that too, it’s so dumb especially when your browser’s language is set to one of them in the first place.

scottmeme@sh.itjust.works on 12 Jun 05:42 next collapse

Accept-Language is usually used for localizations. The 2 main ways that are used to gather location information are the location permissions and IP’s.

The reason IPs are used primarily is they don’t need user consent since it’s being sent to the server. It allows an easy way to determine a close enough location for search results since it can get down to a metroplex or city.

undefined@lemmy.hogru.ch on 12 Jun 05:46 collapse

Is user consent needed for the Accept-Language header? That would be kind of insane. I realize that it could be considered identifiable but that still feels strange to me.

I’m thinking mostly of localization, primarily language.

scottmeme@sh.itjust.works on 12 Jun 06:06 collapse

Localizations are used to convert between different languages. Just having a country code inside a header doesn’t give enough context where you are. For example states/provinces and their respective cities. Most of that is easily collected from the GeoIP information to give you local results for your area.

Edit: here’s an example of one of the bigger GeoIP APIs that provides the data so you can see the example for your own IP

ipgeolocation.io/what-is-my-ip/

Deestan@lemmy.world on 12 Jun 06:14 next collapse

It’s also such an broken idea that I can only imagine it comes from american tech bros who have a childish view of the world.

“Yes this area is germany people in germany speak german so websites must german problem solved”

No:

  • I am Norwegian. I sometimes gasp TRAVEL. Taking a train through Germany to get to France doesn’t mean I want Google to go all “Dieses Suchenwiegenflassen gewürst fleinmescht bitte” at me when I search for pictures of cute cats.
  • Some countries have multiple official languages.
  • Some people technically in Norway living close to the border just speak swedish.
  • Expats.
  • I don’t want badly translated websites in Norwegian. Just give me English. Microsoft Bing for years had a setting that when translated back to English said “Number of results: Car”.
undefined@lemmy.hogru.ch on 12 Jun 06:21 next collapse

I’m an American tech worker (not bro thankfully) and I’ve seen the poor translation issue firsthand: using Google Translate on the backend to transparently translate the website on the fly.

I also happen to be multilingual and it’s just unbearable watching some of this stuff play out. Storing translations and switching between them at a technical level isn’t really hard. I wish companies would invest in translation services instead of relying on Google or some other equally bad service.

A_norny_mousse@feddit.org on 12 Jun 08:31 collapse

using Google Translate on the backend to transparently translate the website on the fly.

This is what they call “modern cloud-based solutions”. Except, now it’s “modern AI-based solutions” - same shit with a different label.

I am now trying to imagine how that works. Every time a client calls the website with an unseen (and IP-based of course) language? Do they at least cache whatever google returns?

Storing translations and switching between them at a technical level isn’t really hard.

Esp. as you yourself pointed out, the internet has been multilingual for decades now.

schnurrito@discuss.tchncs.de on 12 Jun 06:22 next collapse

Dieses Suchenwiegenflassen gewürst fleinmescht bitte

As a native speaker of German: lol

I mainly notice this with YouTube ads when in a foreign country. YouTube, you have my viewing history, you know I don’t watch videos in Italian or Hungarian because I don’t understand those languages well, so why are you advertising to me in those languages just because my IP geolocates to Italy or Hungary???

Thorry84@feddit.nl on 12 Jun 06:31 collapse

I so hate the bad translations. Please just give me the app in whatever native language it was built in. And if I can’t understand that language, let me switch to English. It’s awful to use an app and have to translate everything yourself back to the native language to figure out what they actually meant and what went wrong in the translation.

And it’s especially annoying when errors and such are also translated. These often make even less sense and when trying to search the internet, it really helps if the error is in the language of largest user base.

i_am_not_a_robot@feddit.uk on 12 Jun 07:41 next collapse

I’m in England and my language is set to English, yet for some reason when I was browsing AliExpress a few weeks ago it was stuck in German and I couldn’t see how to change it. Go to the homepage - German. Click on a result from a search engine - German.

I don’t know where it got that from, it wasn’t the IP either as from a computer on the same address it was fine.

Sir_Kevin@lemmy.dbzer0.com on 12 Jun 14:21 collapse

AliExpress in particular is terrible with however they’re going about language selection. I have had this happen countless times and I don’t even travel or use a VPN. Like it’s based on a merchant you viewed or some other nonsense.

[deleted] on 12 Jun 07:59 next collapse
.
A_norny_mousse@feddit.org on 12 Jun 08:40 next collapse

One reason is that IP’s can be more granular as another user pointed out. OTOH that doesn’t always work so well, either - I often get pinpointed to a location some 100km from where I actually am.

Another reason could be to circumvent people’s privacy settings, which are becoming more popular even without using a VPN. Essentially a sort of “we don’t trust you with the data you give us about yourself”.

And since others brought up search engines etc., there’s a third reason: I always use English on my computer UI, but I am not in England and English is not my first language. Sometimes it’s nice to still get localised results (DDG has a drop-down to change this on the fly though).

Oh, and while trying to find a site that tells me where it thinks my IP is located right now I noticed that the top search results all ask location permissions and show me nothing without them. And “Location” is a combo of IP, cell tower and GPS. It might come down to IP only on a laptop, but soon maybe not anymore.

IsThisAnAI@lemmy.world on 12 Jun 09:01 next collapse

Because they don’t make, or give a flying flip any you and vpn users. You are an not an important population to optimize around.

undefined@lemmy.hogru.ch on 12 Jun 15:11 collapse

I’m not arguing that I am. I’m arguing that using an IP address to determine language settings is stupid, regardless of whether I’m using a VPN.

bananabread@lemmy.zip on 12 Jun 10:43 next collapse

Relevant: vitonsky.net/blog/2025/05/17/language-detection/

dontbelievethis@sh.itjust.works on 12 Jun 15:04 next collapse

It’s to annoy you into not using a VPN.

Yaky@slrpnk.net on 13 Jun 21:39 collapse

Honestly, plain old ignorance. (and some anglo-centrism)

I am a software dev, worked on two translation projects at different points in time, and both of them were kind of a mess. In one case, translation team was all Americans (US company), and I was the only person who spoke another language and had firsthand experience with bad translation in media. When I asked how to switch the language in their app, senior dev told me to switch my OS language. Translations themselves often sounded overly verbose, robotic, or plain weird in other languages.

And then, the typical oversights like not leaving enough screen space for longer translated text, using ambiguous terms without providing context, badly splitting phrases. Text-in-image, etc.