Live data from Hacker News

Accept my accept-language

blog.choibean.com

71–76 of 76 posts

Re: Accept my accept-language

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

> Imagine walking up to a computer in a shared space (hotel lobby, library, etc.) and it's been configured to send out accept-language: .

If web browsers could somehow figure out they were running either under a guest/public-use account, or in a kiosk mode, they could avoid sending an Accept-Language header at all. Then,

1. in cases where the header is sent, it would mean a lot more (and hopefully override both online-profile-stored and IP-detection-based answers);

and 2. in cases where the header isn't sent, using an answer from an online profile setting or IP-detection would no longer be against-standard.

Re: Accept my accept-language

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

While that excuses ignoring the Accept-Language header, it doesn't make sense for overriding the user's explicit configuration in their profile; you wouldn't expect that to be shared.

That, and I'd expect public computers to disallow that sort of configuration anyway, so it would be stuck at the default value, which should be sensible for the location it's set up in; it's not like it would move around...

Re: Accept my accept-language

#73
post #6

I'm working on locale stuff for a Rails app right now (just updated the i18n_data in fact). The assumption will be that country is mostly orthognal to language b/c people are übermobile. Further, that the dialect of the language should not force assumptions of other preferences... only autodiscover initial settings as close to desired as possible. (Fuck, why isn't there a standard for this common, hard-to-manage shit…

You might enjoy https://github.com/jcasimir/locale_setter

Interesting, thanks.

Current Gemfile:

  # ...

  # i18n
  gem 'rails_locale_detection' # consider locale_setter
  gem 'rails-i18n', github: 'steakknife/rails-i18n'
  gem 'i18n_data', github: 'steakknife/i18n_data'
  gem 'countries_and_languages', require: 'countries_and_languages/rails'
  gem 'country_select' # for simple_form

  # tz
  gem 'tzinfo-data', '>= 1.2014.1'
  gem 'tzinfo'

  # symbols and images
  gem 'svg-flags-rails'

  # idn
  gem 'resolv-idn'   # resolv unicode patch
  gem 'idn-ruby'     # unicode IDNA domain resolution
  # ...

  # ...

Re: Accept my accept-language

#74
post #68
post #63

Earlier quoted context omitted.

They do make sense for many users, and they are the closest you can find to a proper graphical representation of languages. When I add a language that I know to be official in several countries, I look at my analytics to see where most users come from and use the flag from their country. I can't remember a time where it did not also match the country with the most speakers.

It's a common enough practice that most people usually know what it means, but there's a reason you don't see flags on Wikipedia, Facebook, or Youtube. Languages are spoken in many countries, and countries are multilingual. There are quite a few articles around the web on this topic, but that's basically what they boil down to: languages are not countries. Some users may be confused or offended that their flag is not…

And as a Canadian I find it generally a little weird that the Canadian flag often means Canadian French, and I have to click the US flag to get English (which is of course a slightly different English than Canadian English which is probably unavailable).

I guess it's something like "language most unique to that country", no but that's not right either... I don't know.

Re: Accept my accept-language

#75
post #70

Earlier quoted context omitted.

Huh, I didn't know that. But why geoIP-based redirects on some sites and not others? google.com redirects me to google.dk, and even blogspot.com redirects me to blogspot.dk, but maps.google.com doesn't take me to maps.google.dk.

I believe the logic was that "google.com" always does the redirect, because people tend to type google.com manually into their address bar a lot. Google has never bothered to set up any other redirects itself. Other services that Google has acquired, though (e.g. Blogger, Youtube, etc.) may have come pre-set-up with redirection logic, and Google has mostly left that untouched.

Blogspot changed their behavior long after Google bought them.

Re: Accept my accept-language

#76
post #30

Earlier quoted context omitted.

I live in Switzerland and google does follow my accept-languages (en-US,en;q=0.8,fr;q=0.6,de;q=0.4). When going to google.com in incognito I get google.ch in english which is what I asked.

I don't get that behavior in Firefox. I have 'en-US' and 'en' as my preferred languages (in that order), set via Preferences->Content->Languages. But when I go to google.com in incognito, I get google.dk in Danish. I guess English is preferred here commonly enough that it's at least listed as one of the two alternate google.dk languages in an easy-to-find place under the search box, along with Faroese. "Google.dk på:…

Ok, I think the trick is to have at least one more in addition to en-US+en (I have a couple more).
Post reply on HN