[whatwg] Proposal: Locale Preferences API

Jungshik Shin (신정식, 申政湜) jshin at chromium.org
Wed Nov 27 13:28:04 PST 2013


The proposal looks good except for one reservation I have about. A few
years ago, we proposed a similar API to webkit-dev, but it's 'killed' there
and we didn't bring it up in whatwg (Chromium ended up adding an extension
API for that for Chrome extensions).

My reservation is :  it's not a good idea to "conflate" the browser's UI
language and the ordered list of preferred content languages
(Accept-Language).  Specifically, I think it's better to leave alone
'navigator.language' when the preferred list of languages is changed.


*2.1 If the first item of the lang list is not the same value as the value
of*
*the 'navigator' object's `language` attribute, update the `navigator`
object's `*
*attribute` to be the first item lang list.*

That is, I suggest that 'navigator.language' always be the UI language of a
web browser. When the 'preferred lang list' changes, it should NOT affect
'navigator.language' (singular) but ONLY updates 'navigator.languages'
(plural).

If 'language vs languages' is likely to cause confusion/errors, we might as
well choose to use 'preferredLanguages' or 'preferredContentLanguages' for
the latter.


Jungshik






2013/10/16 Erik Arvidsson <arv at chromium.org>

> This looks very useful and the proposal looks solid.
>
>
> On Mon, Oct 14, 2013 at 6:43 PM, Ian Hickson <ian at hixie.ch> wrote:
>
> > On Mon, 14 Oct 2013, Marcos Caceres wrote:
> > >
> > > Ping?
> > >
> > > Mozilla would like to know if anyone else is interested or specially if
> > > people are NOT interested. We would like to implement this and expose
> it
> > > on the platform.
> > >
> > > See:  https://bugzilla.mozilla.org/show_bug.cgi?id=780953
> >
> > I was just looking at this, actually. I filed the following bug to track
> > it: https://www.w3.org/Bugs/Public/show_bug.cgi?id=23517
> >
> > Seems like a reasonable feature to me, FWIW.
> >
> > See also:
> >
> >    Notification of change to navigator.language (locale change)
> >    https://www.w3.org/bugzilla_public/show_bug.cgi?id=21289
> >
> >    API to expose locale-specific settings
> >    https://www.w3.org/Bugs/Public/show_bug.cgi?id=22679
> >
> >    API to expose actual language of a node, to aid scripts doing
> >    localisation and CJK editors during copy&paste and drag&drop
> >    https://www.w3.org/Bugs/Public/show_bug.cgi?id=23512
> >
> > --
> > Ian Hickson               U+1047E                )\._.,--....,'``.    fL
> > http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
> > Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
> >
>
>
>
> --
> erik
>


More information about the whatwg mailing list