This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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).
See also: http://lists.w3.org/Archives/Public/public-sysapps/2013Mar/0097.html FireFox OS has a mutation observer that watches for changes in "language.current" of "navigator.mozSettings": navigator.mozSettings.addObserver('language.current', function(event) { … }); Blackberry also has an event for this: http://developer.blackberry.com/html5/api/blackberry.system.html#.event:languagechanged
There were some ideas to push a Web l10n specification that would add a 'locale-change' event (or something similar) fired to the document object. I am not sure how such a specification would be followed though.
For the record, Firefox OS is using this: https://github.com/fabi1cazenave/webL10n
This would be easy to spec if anyone wants to implement it. Who wants to implement it? See also bug 17859.
Mozilla has expressed interest in implementing.
Yes, we are interested, at least in an application context (like Firefox OS) where such a feature would be very useful.
*** Bug 22242 has been marked as a duplicate of this bug. ***
There's a "languagechange" event that fires at Window when navigator.languages change. Language and locale are different, but since currently we don't expose any locale stuff, it might be a moot point...
I'm marking this WORKSFORME since the actual request has been done. I'm sure if we add locale stuff that we'll add locale change notifications as part of it.