Blogmark

Don't Guess My Language

via jbranchaud@gmail.com

https://vitonsky.net/blog/2025/05/17/language-detection/
Web Development Language Locale

Every browser sends an Accept-Language header. It tells you what language the user prefers, not based on location, not based on IP, based on their OS or browser config. And yes, users can tweak it if they care enough.

It looks like this: Accept-Language: en-US,en;q=0.9,de;q=0.8

That’s your signal, use it. It’s accurate, it’s free, it’s already there, no licensing, no guesswork, no maintenance.

As an example of when the location associated with an IP address is a reasonable heuristic: many course selling platforms use that to determine what if any Purchase Power Parity (PPP) discount to offer.