2014-03-15

Accept my accept-language

I have a pretty simple accept-language setting in Chrome:


Quick check reveals this to be "en-US,ko;q=0.8" and according to the RFC, this is roughly "I prefer American English, but will accept Korean." English has the default quality value of 1, while Korean has 0.8.

But for some reason this is a difficult concept for people:




My guess is either:

  1. the default quality value is being parsed wrong, and English is being assigned q=0 instead of q=1 or
  2. en-US doesn't match en and is being bypassed,
leading the server to believing Korean is my preferred language. To be fair, the RFC does state that "all languages are equally acceptable" but it's still somewhat annoying that my preferred order is being ignored.

Localization is hard.

updated 2014-03-16 18:08:00 UTC

Once I updated the Chrome settings again (with the same order), my accept-language now reads "en-US,en;q=0.8,ko;q=0.6" and everything works "as expected". #2 above was likely the culprit, and at some point between when I last changed language settings and now, Chrome must have fixed this behavior on the header settings.

11 comments:

  1. Google doesn't care about accept-language. If I came from Japan, it'll show everything in Japanese with a small hint suggesting that I may be looking for results in English.

    ReplyDelete
  2. Try setting plain English, without any locale before your native tongue. It should look something like en-us, en, ko

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. I am in the same boat as a Hungarian in Romania.
    (And there are a lot of countries where a big proportion of the people are speaking another language. I guess that in all these case, google is always forcing the country main language)

    ReplyDelete
  5. I live in Italy. This is my setting: "en-US,en;q=0.8,it;q=0.6" and I get redirected to google.it when I type google.com

    ReplyDelete
  6. Google are using your location rather than any headers you use to make the decision... Silly to ignore the user, but they do!

    ReplyDelete
    Replies
    1. Sorry, I should have clarified - I'm in California, so that's not likely to be the case.

      Delete
  7. If all else fails, there's always google.com/ncr (no country redirect) which will let you stay on .com.
    Altough my accept language header seems to work from Switzerland: "en-us,en;q=0.7,de;q=0.3" but will redirect me to google.ch.

    ReplyDelete
    Replies
    1. In fact it doesn't work the way you would expect it to as your accept-language would mean: "I prefer English, but will accept German."

      Delete
    2. I went back in the Chrome settings and set the settings to the same order, it reset my header to this instead: "en-US,en;q=0.8,ko;q=0.6" - similar to yours. This now makes everything work "as expected" from my point of view. I haven't touched my language settings since ~2012, so it's possible Chrome "fixed" this since then, but didn't change users' existing settings.

      Delete
  8. Hi choibean, I'm the main web developer from dolphin-emu.org (and not much of a web developer really... I loathe it as you would expect it from a low-level, systems programming guy :p

    This was actually a bug in our language detection code, that I just fixed on the live website: https://github.com/dolphin-emu/www/commit/ddef974c6f601bc2dbbcc499c8990f4dd074615f

    I never noticed it because en-US,en,ko;q=0.8 would get detected automatically as "english" and browsers often add the non region-specific language in the Accept-Language. In fact, when I tried reproducing the bug with Chrome, I could not, because Chrome seems to add ,en, in the Accept-Language even with the same configuration you're using!

    I'm very sensitive to these kind of issues too, being a french speaker in a german country with an Accept-Language configured to get english first :) I probably rage about that just as much as you do. When I set up country redirection on dolphin-emu.org I decided to trust Accept-Language because that should, imo, be the source of truth. Looks like I screwed up :)

    Thanks a lot for this bug report, it could have gone unnoticed for a long time!

    ReplyDelete