<?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>21289</bug_id>
          
          <creation_ts>2013-03-14 19:36:52 +0000</creation_ts>
          <short_desc>Notification of change to navigator.language (locale change)</short_desc>
          <delta_ts>2014-09-29 23:36:11 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          <see_also>https://www.w3.org/Bugs/Public/show_bug.cgi?id=22679</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>Needs Impl Interest</target_milestone>
          
          <blocked>21290</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Marcos Caceres">w3c</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>bugs</cc>
    
    <cc>ehsan</cc>
    
    <cc>ian</cc>
    
    <cc>marcosscaceres</cc>
    
    <cc>mike</cc>
    
    <cc>mounir</cc>
    
    <cc>w3c</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>84442</commentid>
    <comment_count>0</comment_count>
    <who name="Marcos Caceres">w3c</who>
    <bug_when>2013-03-14 19:36:52 +0000</bug_when>
    <thetext>Users sometimes need to switch locale settings on their device. When this happens, the value of navigator.language is changed (or should be!). It would be nice if HTML provided some means to be notified that the change had taken place. 

The application can then use this information to perform appropriate localization changes on the client side. For example, reformatting DOM elements that contain times and dates to better suit the new locale information (this could work together with the  ECMAScript i18n API).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84443</commentid>
    <comment_count>1</comment_count>
    <who name="Marcos Caceres">w3c</who>
    <bug_when>2013-03-14 19:40:58 +0000</bug_when>
    <thetext>See also: http://lists.w3.org/Archives/Public/public-sysapps/2013Mar/0097.html

FireFox OS has a mutation observer that watches for changes in &quot;language.current&quot; of &quot;navigator.mozSettings&quot;:

navigator.mozSettings.addObserver(&apos;language.current&apos;, function(event) { … });

Blackberry also has an event for this:
http://developer.blackberry.com/html5/api/blackberry.system.html#.event:languagechanged</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84494</commentid>
    <comment_count>2</comment_count>
    <who name="Mounir Lamouri">mounir</who>
    <bug_when>2013-03-15 22:59:42 +0000</bug_when>
    <thetext>There were some ideas to push a Web l10n specification that would add a &apos;locale-change&apos; event (or something similar) fired to the document object. I am not sure how such a specification would be followed though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84936</commentid>
    <comment_count>3</comment_count>
    <who name="Mounir Lamouri">mounir</who>
    <bug_when>2013-03-25 18:27:55 +0000</bug_when>
    <thetext>For the record, Firefox OS is using this: https://github.com/fabi1cazenave/webL10n</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86974</commentid>
    <comment_count>4</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-04-29 23:40:36 +0000</bug_when>
    <thetext>This would be easy to spec if anyone wants to implement it.

Who wants to implement it?

See also bug 17859.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86997</commentid>
    <comment_count>5</comment_count>
    <who name="Marcos Caceres">w3c</who>
    <bug_when>2013-04-30 10:26:19 +0000</bug_when>
    <thetext>Mozilla has expressed interest in implementing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87006</commentid>
    <comment_count>6</comment_count>
    <who name="Mounir Lamouri">mounir</who>
    <bug_when>2013-04-30 14:46:15 +0000</bug_when>
    <thetext>Yes, we are interested, at least in an application context (like Firefox OS) where such a feature would be very useful.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88565</commentid>
    <comment_count>7</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2013-06-03 09:32:22 +0000</bug_when>
    <thetext>*** Bug 22242 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109146</commentid>
    <comment_count>8</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-07-21 20:57:47 +0000</bug_when>
    <thetext>There&apos;s a &quot;languagechange&quot; event that fires at Window when navigator.languages change.

Language and locale are different, but since currently we don&apos;t expose any locale stuff, it might be a moot point...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112429</commentid>
    <comment_count>9</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-09-29 23:36:11 +0000</bug_when>
    <thetext>I&apos;m marking this WORKSFORME since the actual request has been done. I&apos;m sure if we add locale stuff that we&apos;ll add locale change notifications as part of it.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>