This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 17878 - define navigator.language
Summary: define navigator.language
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://lists.w3.org/Archives/Public/p...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-18 07:10 UTC by contributor
Modified: 2013-03-08 23:47 UTC (History)
6 users (show)

See Also:


Attachments

Description contributor 2012-07-18 07:10:50 UTC
This was was cloned from bug 17479 as part of operation convergence.
Originally filed: 2012-06-13 10:39:00 +0000
Original reporter: Anne <annevk@annevk.nl>

================================================================================
 #0   Anne                                            2012-06-13 10:39:29 +0000 
--------------------------------------------------------------------------------
All browsers support it. We should document that somewhere and somewhere might as well be where the Navigator object is defined.

Maybe "en" should be used as value when the user wants to reduce fingerprinting. Though given all the other exposed fingerprinting data this might not be worth mentioning.
================================================================================
 #1   Simon Pieters                                   2012-06-13 10:59:34 +0000 
--------------------------------------------------------------------------------
$ grep -aPhc "navigator\.language" web200904 
3354

$ grep -aPhc "navigator\.language" stevef-all 
53
================================================================================
 #2   Simon Pieters                                   2012-06-13 11:15:20 +0000 
--------------------------------------------------------------------------------
I quickly looked through the stevef-all (which is from http://www.paciellogroup.com/blog/2012/04/html5-accessibility-chops-data-for-the-masses/ ) matches. Most or all of them also use navigator.userLanguage or navigator.browserLanguage or navigator.systemLanguage if navigator.language is not defined. The common usage of this API seems to be for tracking, although there are probably some that use it for localization purposes as well.
================================================================================
Comment 1 Ian 'Hixie' Hickson 2012-09-27 23:50:54 UTC
I didn't spec it before because interop sucks, according to my notes in the spec:

   <!-- v2: also, could expose languages:
   <dt><dfn title="dom-navigator-browserLanguage"><code>browserLanguage</code></dfn></dt> <!- - Opera and IE only - ->
   <dd><p>Must return either null or a language tag representing the language the browser uses in its interface.</p></dd>
   <dt><dfn title="dom-navigator-userLanguage"><code>userLanguage</code></dfn></dt> <!- - Opera and IE only - ->
   <dt><dfn title="dom-navigator-language"><code>language</code></dfn></dt> <!- - Opera, Safari, and Mozilla only - ->
   <dd><p>Must return either null or a language tag representing the user's preferred language.</p></dd>
   -->
Comment 2 Ian 'Hixie' Hickson 2012-12-29 23:22:32 UTC
Added language. Hopefully that's enough.
Comment 3 Anne 2013-01-05 12:13:24 UTC
I doubt returning a non-string value is compatible enough. I'd suggest we make that the empty string or simply "en".
Comment 4 Ian 'Hixie' Hickson 2013-03-08 23:47:03 UTC
Ok.
Comment 5 contributor 2013-03-08 23:47:48 UTC
Checked in as WHATWG revision r7746.
Check-in comment: Default navigator.language to 'en' instead of null.
http://html5.org/tools/web-apps-tracker?from=7745&to=7746