Live data from Hacker News

Accept my accept-language

blog.choibean.com

51–60 of 76 posts

Re: Accept my accept-language

#51
post #31

Earlier quoted context omitted.

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 se…

It's true that most people leave the defaults. However, there may an easy solution for a subset of cases.

Do the browser defaults in any country include multiple language settings? It seems likely that in most countries, the default would be only one language. And if this is the case, then if multiple alternatives are present in the request headers, it's very likely the user or computer admin has deliberately changed it, and that in turn would mean that sites should respect the choices.

This might still be wrong in when the settings were made by someone other than the current user, or there are multiple languages default-configured, but it might be a step in the right direction.

Re: Accept my accept-language

#52

Google is^H^Hwas* really bloody annoying when it comes to this. English (en-us and en) is the only language in my accept header. When I lived in Geneva though, Google always used to serve me pages in German (presumably Swiss-German). Gee, that's logical. (Geneva is a mainly French speaking city, though over 40% of the population is non-Swiss.) Where I live now is another French speaking area. I just checked and it se…

Worse: Google went through a period of normally serving me French-language pages.

I'm not in a French-speaking country. I don't have French in my accept header. I never expressed any preference towards the French language.

But, my ISP was Orange (France Telecom) and I had a variable IP from them.

Re: Accept my accept-language

#53
There is also the problem of getting the original content, I speak 3 langages, I intend to read the original source if it's one of those language. I don't want unpaid-intern translation.

MS C# documentation deserve a special kind of hell, because they detected I reverted the language to english ; and now they present me a special translation mode of their freaking doc where there are huge tooltip texts everywhere.

Re: Accept my accept-language

#54

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 Inter…

What we've done for dolphin-emu.org:

* In all cases, a fairly visible language picker is displayed at the top of the page, with internationalized language names.

* If someone goes to a language-specific subdomain (fr.dolphin-emu.org, cy.dolphin-emu.org, ast.dolphin-emu.org, ...), they get this version.

* If someone goes to the generic/english dolphin-emu.org, the system checks whether the user has a "nocr" cookie. If so, they get the english website. Otherwise, they get redirected based on their Accept-Language.

* If a user uses the language picker, we assume they know what they want and set the "nocr" cookie to disable redirections in the future.

* When the user gets redirected from the standard/english version to an internationalized version, a message is shown in english saying that they have been redirected based on their browser preferences, with a link to go back to the english version (and set the "nocr" cookie).

I thought for a pretty long time about this and think it is a good compromise between providing the best version for our users and not being annoying/guessing too much. In the end, more than 50% of our users now are shown internationalized versions of our website, which is a very good number in my opinion.

Re: Accept my accept-language

#55
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.

The flag doesn't work for the billion people of India. We are massively multilingual; we have 22 official languages. Google.co.in is offered in 9 of those 22 languages -- each one with its own unique script, which are mutually un-intelligible. One Indian flag for all languages? No, thanks. Look at the confusion caused by the Metropolitan Police website [1].

If you can afford two pop-up lists, the approach of Lufthansa is the best [2]. If you want just one list, follow the installation screen of Ubuntu -- they write out the name of the language in its own script.

[1]: http://flagsarenotlanguages.com/blog/2011/09/the-metropolita...

[2]: http://www.lufthansa.com/de/en/pre-homepage?command=cc&lang=...

Re: Accept my accept-language

#56

There is also the problem of getting the original content, I speak 3 langages, I intend to read the original source if it's one of those language. I don't want unpaid-intern translation. MS C# documentation deserve a special kind of hell, because they detected I reverted the language to english ; and now they present me a special translation mode of their freaking doc where there are huge tooltip texts everywhere.

I don't know when, might be due to the language of your Windows installation, but sometimes in .NET they even translate exceptions and other error codes to your local language making it impossible to use google for troubleshooting.

Re: Accept my accept-language

#57
post #49

Earlier quoted context omitted.

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: p…

Having now read the full code and not just the diff, I have to say it looks pretty good. I note that plain "zh" is not redirected to the cn site. ;) Whether it should or not is debatable though -- I actually think ignoring "zh" altogether is a rather prudent move if it is intentional.

Re: Accept my accept-language

#58
post #15

Earlier quoted context omitted.

Very minor point: the right thing to do is to not infer the language, specially not from the IP, if no explicit information is available. You shoukd make the user choose or take him/her to the default language (there should be an obvious way to change the language from there anyway) If you have multiple language, hopefully you already have a scheme to differentiate the language (i.e. wikipedia has the language in the…

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?

I think it could be anything making sense (the default for a german company could be german for instance) as long as switching away is smooth and discoverable. People not familiar with the english alphabet for instance could be lost in the site, getting overwhelmed by the unknow information, even if they know the word "english" or "language". For people like in that case, the page could be in french it wouldn't make much difference.

As a visual marker for language switching I imagined having a flag, but looking at the replies, that seems non optimal.

The best behavior could be a popup shown only to users who's accepted languages don't match the current language, and keep the choice in a cookie perhaps ?

Re: Accept my accept-language

#59
post #56

There is also the problem of getting the original content, I speak 3 langages, I intend to read the original source if it's one of those language. I don't want unpaid-intern translation. MS C# documentation deserve a special kind of hell, because they detected I reverted the language to english ; and now they present me a special translation mode of their freaking doc where there are huge tooltip texts everywhere.

I don't know when, might be due to the language of your Windows installation, but sometimes in .NET they even translate exceptions and other error codes to your local language making it impossible to use google for troubleshooting.

yeah, translated error messages are a pain to google. sometimes we can get away we error codes.

(I'm using mono on a mac, and I'm not really doing important stuff).

Re: Accept my accept-language

#60
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…

Thanks! There is a corollary to this that would have prevented all this - when I went back in the Chrome settings and set the settings to the same order, it reset my header to this: "en-US,en;q=0.8,ko;q=0.6" - which makes things work for all sites again. I haven't touched my language settings since ~2012, so it's possible Chrome "fixed" this a while back, but didn't change my existing settings.
Post reply on HN