W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2016

Re: [whatwg] Should navigator.language and and/or HTTP Accept-Language include locale?

From: Anne van Kesteren <annevk@annevk.nl>
Date: Tue, 24 May 2016 08:05:56 +0200
Message-ID: <CADnb78h10pHTF6o763DqFKRFNKn4iBa_PVjgCipt+85FC-1=zw@mail.gmail.com>
To: Geoffrey Garen <ggaren@apple.com>
Cc: WHAT Working Group <whatwg@whatwg.org>, Phil Pizlo <fpizlo@apple.com>, Alexey Proskuryakov <ap@apple.com>
On Mon, May 23, 2016 at 11:58 PM, Geoffrey Garen <ggaren@apple.com> wrote:
> For example, if I speak English but I like Polish number formatting, should navigator.language report “en-pl”?

I don't think so. That would only make sense if English was a language
spoken in Poland that differs from other English languages. Contrast
with en-GB and en-US which would make sense as values and don't imply
a locale necessarily.


> In researching this question, I discovered that lots of code uses navigator.language and/or HTTP Accept-Language to infer the user’s locale, despite the fact that language and locale are not equivalent.

I don't think we expose locale currently, although I have not studied
ECMA-402 in detail which I suspect might reveal some of it, only the
language.


-- 
https://annevankesteren.nl/
Received on Tuesday, 24 May 2016 06:06:27 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:38 UTC