mdn.io
mdn.io copied to clipboard
Use Accept-Language to determine the language parameter to pass to search engines
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.
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".
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. 🙄