Live data from Hacker News

Accept my accept-language

blog.choibean.com

41–50 of 76 posts

Re: Accept my accept-language

#41
post #31
post #25

Pretty much every major site will completely ignore not only your browser's language settings but also onsite user account settings and other desperate attempts at selecting the language. The only thing that matters is your IP address. For example, accessing Google: my browser is set to accept English only. I'm entering the English URL. In my account settings I periodically reset everything I can find to English (set…

can anyone provide insight into the business reasoning behind this? i really can't conceive of why you would want to supersede a user's exact, known language with a guess. sites are pretty difficult to use when you can't read anything. maybe there are technical issues for some sites, but Google search is the worse i've ever dealt with, and they def have some resources behind that.

Mostly it's because people don't know how to change that setting. Imagine walking up to a computer in a shared space (hotel lobby, library, etc.) and it's been configured to send out accept-language: .

Many of the people reading Hacker News will be able to find and change that setting. My mom never will. She'll just know she went to google.com, and saw Chinese.

If you're using a computer in a country, and websites seem to be showing you things in the language of that country, that's something you can probably understand. If you're using a computer and some websites insist on showing you some other language, you'll be confused.

Re: Accept my accept-language

#42
post #24

Earlier quoted context omitted.

> and Google's especially bad about this Google is a Royal Pain in the Ass on this point. They completely disregard any request configuration and decide on output language based on IP geolocation (which is pretty much always Not What I Want, even more so in multilingual countries such as Belgium or Switzerland[0]), then Chrome "helpfully" suggests translating documents. [0] where it won't even send you something matc…

This gets very fun once you start using a vpn from another country.

Indeed, and sometimes strange things happen:

ssh tunnel from Australia to server located in California. Geo IP tool [1] reports it's in Fremont, CA. But Google assigns Taiwanese locale..

Outdated/erroneous geolocation database? or did I take a wrong turn somewhere ;-)

[1] http://www.geoiptool.com

Re: Accept my accept-language

#43
accept-language is like any of 1000 other idealistic parts of Internet specs that has good intentions but is so poorly used (or misused) that almost no-one implements it correctly, instead simply doing the simplest thing that works best for 99% of the audience.

Re: Accept my accept-language

#44
post #26

Earlier quoted context omitted.

This is what so many websites do now. It causes me constant aggravation. It's nothing to do with your browser settings. They infer your language from your IP address, and for most cases that IS the right thing to do. However for me it isn't. I really really wish there was a way to configure your browser to force websites to accept your language settings. The only other option is to enable cookies so that the website…

> They infer your language from your IP address, and for most cases that IS the right thing to do. If IP and accept-language don't match, why not make a prominent button (in the language they didn't pick) to allow you to quickly change?

This is the best option.

"It looks like you are in Japan, but your computer's language is set to English. Which language would you prefer? [English][日本語]"

Re: Accept my accept-language

#45
Sorry, when I implement language negotiation I interpret "en-US" as lack of preference.

The problem is that en-US is the default and I can't tell difference between user not setting language and user choosing en-US.

Add "en" or even "en-GB" to your Accept-Language header.

Re: Accept my accept-language

#46

I'm running an English version of Windows 7 in Sweden. The accept-language headers in each of my installed browsers are: * IE9: sv-SE * Firefox: en,sv;q=0.5 * Chrome: en-US,en;q=0.8,sv;q=0.6 I'm going to go ahead and suggest that the reason English comes before Swedish is due to my system language, and that Swedish otherwise would come first. The "users will have the wrong settings" argument seems moot to me.

I know people who have their OS in English even though they're not fluent in English - they can't be bothered to reinstall OS that came with the laptop (or cracked torrent) and understanding a few words like "ok/cancel" is enough.

Re: Accept my accept-language

#47
post #45

Sorry, when I implement language negotiation I interpret "en-US" as lack of preference. The problem is that en-US is the default and I can't tell difference between user not setting language and user choosing en-US. Add "en" or even "en-GB" to your Accept-Language header.

It isn't the default for most people. Download a browser and OS localized to German, French, or British English and Accept-Language defaults to that instead of "en-US".

Re: Accept my accept-language

#48
post #29

Earlier quoted context omitted.

Would assuming that the default language is English be valid? I know a large percentage of the Internet probably doesn't "know English", but if they can connect to the Internet, would they at least recognise enough words (like "language"") that they can choose a different language?

What makes you think that? If their computer came with an OS preinstalled, with Mongolian, for example, as the language, they would not have to ever see any English anywhere. A flag might be more universally recognized way of selecting the right language.

Or just have each language option specified in said language, so that native-only speakers and pick it out.

Re: Accept my accept-language

#49
post #27

I just fixed dolphin-emu.org, this was a bug in our code that would not detect en-US as being "compatible" with en. See https://github.com/dolphin-emu/www/commit/ddef974c6f601bc2db... As a French guy leaving in the German part of Switzerland with Accept-Language configured to get English content, I'm kind of ashamed to have that kind of bug in my language detection code. I'm always complaining about other websites la…

Please don't do this... I detest sites that try to be clever and serve me Simplified Chinese even though I only have zh-hk in Accept-Language:.

I already have exceptions for things like that. I think our code handles zh_{CN,TW,HK} separately, as well as things like pt_BR vs. pt.

    > curl -I -H 'Accept-Language: zh-hk,en;q=0.8' https://dolphin-emu.org/
    HTTP/1.1 200 OK  # No zh_HK translation (yet!)

    > curl -I -H 'Accept-Language: zh-cn,en;q=0.8' https://dolphin-emu.org/
    HTTP/1.1 302 FOUND
    Location: http://cn.dolphin-emu.org/?cr=cn

    > curl -I -H 'Accept-Language: pt,en;q=0.8' https://dolphin-emu.org/
    HTTP/1.1 200 OK  # No pt translation (yet!)

    > curl -I -H 'Accept-Language: pt-br,en;q=0.8' https://dolphin-emu.org/
    HTTP/1.1 302 FOUND
    Location: http://br.dolphin-emu.org/?cr=br
i18n is hard but I think I've been doing a fairly good job on it. Proud to have more than 50% of our visitors from outside of the US!

Re: Accept my accept-language

#50
Language choices are a mess. There can easily (and often) be conflicting data based on:

- accept-language header

- URL that includes language/region codes as a subdomain or part of the path

- language preferences set in a cookie or account

- IP region detection

In the end, any website is trying to provide the right language most often for their users, and there are no easy answers. When I access webmail from an Internet cafe in China, I don't want the interface popping up in Chinese just because the browser's accept-language is configured for Chinese. Fortunately, it doesn't.

Most web users have never even heard of accept-language, it's just automatically configured by whatever language their browser was installed in, which isn't always the language you want to be browsing in. (E.g. you bought your laptop overseas because it was cheaper, so it runs in English instead of your own language.) It's not a surprise that IP address detection provides the best default experience most of the time, which can then be overridden by URL or user choice, and that accept-language is fairly irrelevant.

Post reply on HN