Live data from Hacker News

Who uses Accept-Language header?

serpapi.com

51–60 of 71 posts

Re: Who uses Accept-Language header?

#51

Question: Can you include two languages with the same level of preference in the Accept-Language header? The idea is that the website chooses which language (between those two) to use.

Unfortunately not. I’d really like to have the semantics of “the website’s native language if I understand it (if it’s one of A/B/C), otherwise English”.

But nowadays it’s a clusterfuck anyway. You often get WebView-based apps were half of the UI uses the OS language, half the browser preference, and the third half the service’s native/local language.

Re: Who uses Accept-Language header?

#52

Even Accept-Language headers aren't really a particularly good solution. I might prefer some sites in Danish, but others I'd like to have en English. Unless browsers allow you to set language on a per site basis, we still aren't really capturing the nuances of language preference. Accept-Language could be a pretty good indicator of a persons language skills, but it's just to far into the browsers settings to be somet…

Accept-Language headers aren't used in a particularly good way by browsers and servers. If used better, they would be a particularly good solution.

The idea you mentioned of browsers allowing the header to be set on a per-site basis would be particularly good.

Another very good solution would be for servers to assign weight to the languages they support, and to combine their weights with the Accept-Language weights to choose the best language in common.

But even as they're implemented and used now, Accept-Language headers are already a way better approach than geo-ip.

Re: Who uses Accept-Language header?

#53
We did. I built a parser for the header weights and what not. It was a fun project and I thought the results were really slick.

It was also easily overridden by a very large language picker in our footer. This override choice is remembered in a long lived cookie.

People complained.

They didn't understand why they were getting whatever language and the picker was apparently too hard to find.

Now we just default everyone to English. They're still free to use the language picker. No one complains.

Re: Who uses Accept-Language header?

#54
post #6

Special mention to Amazon who insist that you want to browse their entire dropshipper directory, on all devices, in the language of whatever you last opened in a non-dubbed version on your TV. (if the original version is even available, they even find ways to offer some BBC shows, of all things, dubbed-only)

For that reason I use shortcuts/bookmarks of the form https://www.amazon.tld/?language=en_US (or whatever your language preference is).

If you’re using the Amazon app on iOS, you can open com.amazon.mobile.shopping://www.amazon.tld/?language=en_US, which does the same for the app.

Re: Who uses Accept-Language header?

#55

Even Accept-Language headers aren't really a particularly good solution. I might prefer some sites in Danish, but others I'd like to have en English. Unless browsers allow you to set language on a per site basis, we still aren't really capturing the nuances of language preference. Accept-Language could be a pretty good indicator of a persons language skills, but it's just to far into the browsers settings to be somet…

> I might prefer some sites in Danish, but others I'd like to have en English. Unless browsers allow you to set language on a per site basis, we still aren't really capturing the nuances of language preference.

This problem is solved already by competent sites. On your first visit to a site, it uses Accept-Language to guess what language you want to see. If you use a language switcher menu to pick a different language, a cookie is used to save your choice. On your next visit to the site, the cookie is sent and that takes precedence over Accept-Language to send you the page in your preferred language. Easy.

If/when you decide to create a user account on the site (if the site even supports that) then your language preference can be stored with your user data so you would see it automatically after you log in even if you're on a different browser/device.

As with many other things, there are already best practices on how to do all this stuff. It's just a matter of getting web devs and their managers to be aware of them and/or care enough about providing a good experience for their users (unfortunately this has turned out to be a huge ask) to find and implement them.

Re: Who uses Accept-Language header?

#56
post #51

Question: Can you include two languages with the same level of preference in the Accept-Language header? The idea is that the website chooses which language (between those two) to use.

Unfortunately not. I’d really like to have the semantics of “the website’s native language if I understand it (if it’s one of A/B/C), otherwise English”. But nowadays it’s a clusterfuck anyway. You often get WebView-based apps were half of the UI uses the OS language, half the browser preference, and the third half the service’s native/local language.

The Accept-Language header, when used properly, provide exactly the semantics you ask for.

Re: Who uses Accept-Language header?

#59

There are two situations that I hate: 1. I have a different IP than usual, so all the sites change to that country - including language, news and search results(Google), etc, even though my browser sets a list of Accept-Language options. It's still me, I know you track me, so why? 2. Changing a multi-language website to a different country, also changes the language to that country, even though by browser sends an Ac…

I hate it too. Not only languages change, but many other things like date formatting, mathematical formatting (using commas rather than dots breaks few things around) and currencies too! And it's a pain to fix as settings often collide and with many applications abusing microfrontends you can even end up in conflicts on the very same pages. Google's the worst offender on all of its services and not just search, youtu…

I want "proper" English, SI units and Euro as default currency. For me, the only thing that sort of works is pretending to be Irish.

Re: Who uses Accept-Language header?

#60

There are two situations that I hate: 1. I have a different IP than usual, so all the sites change to that country - including language, news and search results(Google), etc, even though my browser sets a list of Accept-Language options. It's still me, I know you track me, so why? 2. Changing a multi-language website to a different country, also changes the language to that country, even though by browser sends an Ac…

Having worked in the ecomm industry for quite a while, one thing that always drove me nuts was stores that did not understand that your current location should not drive your store choice and certainly shouldn't drive your language choice. Sure, if you need to guess, then you can use assumed geographic location as a starting point if you like. If you don't know what language someone wants, by all means, use the Accept-Language header to make a best effort. After that, let your visitor select a location and language that they want.

I went through a lot of effort on one project that had something like 90+ country stores to make it work as expected. We used IP-based location to select a store if you hadn't already selected one. We used Accept-Language header if you hadn't selected a language. If we couldn't determine a location via IP address, we had a world map landing page you'd get redirected to so you could select a store where you'd be directed back to the product page for the correct store. Language display was best effort. All of the 'chrome' of the site could be displayed in most every language. Products had limited subsets of language. I don't recall how we resolved that disparity.

> I don't suddenly start speaking a different language if I look at a your site from a different country.

As someone that traveled a lot, I always hated this. Sorry, maybe I'm not fluent enough in German to read your site, but I really do want to order from your German store. Or maybe I really want to order from the US store even though I'm in Germany.

One other aspect of all of this that was *extra* fun was payments. Anti-fraud systems frequently get super suspicious if your location and the store location don't match.

Post reply on HN