<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>22835</bug_id>
          
          <creation_ts>2013-07-30 01:18:02 +0000</creation_ts>
          <short_desc>window.navigator.language should not return &quot;en&quot; for privacy protection</short_desc>
          <delta_ts>2016-04-25 23:57:56 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>HTML5 spec</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Norbert Lindenberg">w3-bugs</reporter>
          <assigned_to name="This bug has no owner yet - up for the taking">dave.null</assigned_to>
          <cc>bzbarsky</cc>
    
    <cc>duerst</cc>
    
    <cc>hsivonen</cc>
    
    <cc>mike</cc>
    
    <cc>mounir</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>robin</cc>
    
    <cc>srl</cc>
    
    <cc>travil</cc>
    
    <cc>w3c</cc>
    
    <cc>www-international</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>91400</commentid>
    <comment_count>0</comment_count>
    <who name="Norbert Lindenberg">w3-bugs</who>
    <bug_when>2013-07-30 01:18:02 +0000</bug_when>
    <thetext>Section 6.5.1.2 Language preferences has the recommendation &quot;user agent implementors are encouraged to return &apos;en&apos; unless the user has explicitly indicated that the site in question is allowed access to the information.&quot;

&quot;en&quot; is the wrong value to recommend here. &quot;en&quot; is a valid language tag, but not the preferred language of the majority of internet users. If user agents started following the recommendation to return &quot;en&quot; for users whose preferred language is not English, then applications would have to treat &quot;en&quot; as meaning &quot;undefined&quot;, i.e., stop providing English-speaking users with their preferred language.

If a user agent wants to protect the user&apos;s privacy by not providing the user&apos;s real preferred language, then it should simply return |undefined|.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91401</commentid>
    <comment_count>1</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-07-30 01:26:44 +0000</bug_when>
    <thetext>Returning undefined is very likely to break pages that use string methods on the return value (e.g. navigator.language.charAt(0) or whatnot).  We want a default value that&apos;s a string; perhaps &quot;&quot;?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91402</commentid>
    <comment_count>2</comment_count>
    <who name="Norbert Lindenberg">w3-bugs</who>
    <bug_when>2013-07-30 01:57:39 +0000</bug_when>
    <thetext>Internet Explorer up to at least version 10 doesn&apos;t have navigator.language, so at this point applications have to deal with it being undefined.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91403</commentid>
    <comment_count>3</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-07-30 02:20:02 +0000</bug_when>
    <thetext>Except to the extent that they do sniffing and take different codepaths in different browsers, of course...

We&apos;ve been bitten far too many times by making something undefined that was already undefined in some one browser and pages suddenly breaking.

But more importantly, think about the situation a few years from now when all UAs return strings except the ones that are implementing the encouragement from the spec (which I expect to be minority UAs).  At that point, those UAs would almost certainly have to return &quot;&quot; (violating this spec) due to compat concerns, assuming the property gets used at all.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91405</commentid>
    <comment_count>4</comment_count>
    <who name="Steven R. Loomis">srl</who>
    <bug_when>2013-07-30 05:41:33 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; If a user agent wants to protect the user&apos;s privacy by not providing the
&gt; user&apos;s real preferred language, then it should simply return |undefined|.

How about &quot;und&quot; = Undetermined ? 
http://www.loc.gov/standards/iso639-2/php/code_list.php</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91408</commentid>
    <comment_count>5</comment_count>
    <who name="Martin Dürst">duerst</who>
    <bug_when>2013-07-30 08:03:41 +0000</bug_when>
    <thetext>&quot;und&quot; would work, and so would &quot;&quot; (which is used in XML and HTML to &quot;switch off&quot; outer lang/xml:lang settings for inner structure). I&apos;d personally prefer &quot;&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91419</commentid>
    <comment_count>6</comment_count>
    <who name="Norbert Lindenberg">w3-bugs</who>
    <bug_when>2013-07-30 18:02:51 +0000</bug_when>
    <thetext>If the concern is that applications use the value of navigator.language without any checking, then &quot;und&quot; is better than &quot;&quot;. &quot;&quot; is not a valid BCP 47 language tag and will result in exceptions when passed to methods in the ECMAScript Internationalization API.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91835</commentid>
    <comment_count>7</comment_count>
    <who name="Mounir Lamouri">mounir</who>
    <bug_when>2013-08-09 14:32:14 +0000</bug_when>
    <thetext>Why do we need to make navigator.language return a fake value while we already provide more information in the HTTP headers?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91983</commentid>
    <comment_count>8</comment_count>
    <who name="Henri Sivonen">hsivonen</who>
    <bug_when>2013-08-13 12:47:36 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; If a user agent wants to protect the user&apos;s privacy by not providing the
&gt; user&apos;s real preferred language, then it should simply return |undefined|.

This makes the user more special (i.e. trackable) than if the user was hiding in the &quot;en&quot; crowd.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92862</commentid>
    <comment_count>9</comment_count>
    <who name="Robin Berjon">robin</who>
    <bug_when>2013-09-03 12:27:25 +0000</bug_when>
    <thetext>Is it common for browsers to return &quot;en&quot; currently? I don&apos;t believe I ever configured any of mine for this, but they all return either en-US or en-GB.

Is there really an &quot;en&quot; crowd to hide in?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126143</commentid>
    <comment_count>10</comment_count>
    <who name="Travis Leithead [MSFT]">travil</who>
    <bug_when>2016-04-25 23:57:56 +0000</bug_when>
    <thetext>HTML5.1 Bugzilla Bug Triage: Works for me. Spec currently gives this advice:

&gt; If the user is using an anonymizing service, then the value &quot;en-US&quot; is suggested; if all users of the service use that same value, that reduces the possibility of distinguishing the users from each other.

Are folks still interested in returning the empty string?

If this resolution is not satisfactory, please copy the relevant bug details/proposal into a new issue at the W3C HTML5 Issue tracker: https://github.com/w3c/html/issues/new where it will be re-triaged. Thanks!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>