mdn.io icon indicating copy to clipboard operation
mdn.io copied to clipboard

Use Accept-Language to determine the language parameter to pass to search engines

Open lazd opened this issue 11 years ago • 2 comments

The Accept-Language header should be used to determine the language to restrict search results to.

See Accept-Language RFC and Google's language collection values.

DuckDuckGo seems to support the kl and kad parameters that serve a similar function. These should be investigated as well.

lazd avatar Oct 25 '13 16:10 lazd

Yes, great idea. Reading the Accept-Language header and writing a corresponding lr value for Google is doable. Btw, I've checked in my browser (English version of Firefox) for a couple of sites, and the Accept-Language value that the browser is sending is "en-US;en;q=0.5".

simevidas avatar Oct 25 '13 17:10 simevidas

I second this. Currently, [mdn.io/Error.prototype.stack](http://mdn.io/Error.prototype.stack) points to the German version of the page, despite my browser sending Accept-Language: en-AU,en-GB;q=0.7,en;q=0.3 as an HTTP header. I also confirmed that DuckDuckGo's "Language" setting was set to "Browser preferred default" in the Settings page).

Also, all variations of English can safely be mapped to en-US, since that's the only regional variant of English that MDN supports. 🙄

Alhadis avatar Aug 30 '22 13:08 Alhadis