The onlanguagechange property of the WorkerGlobalScope interface represents an EventHandler to be called when the languagechange event occurs and bubbles through the Worker.


self.onlanguagechange = function() { ... };


The following code snippet shows an onlanguagechange handler set inside a worker:

self.onlanguagechange = function() {
  console.log('Your preferred language settings have been changed');


Specification Status Comment
HTML Living Standard
The definition of 'WorkerGlobalScope.onlanguagechange' in that specification.
Living Standard  

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
onlanguagechangeChrome Full support 4Edge Full support 12Firefox Full support 74IE Full support YesOpera Full support 11.5Safari Full support 4WebView Android Full support 37Chrome Android Full support 40Firefox Android No support NoOpera Android Full support YesSafari iOS Full support 5.1Samsung Internet Android Full support 4.0


Full support  
Full support
No support  
No support

See also

The WorkerGlobalScope interface it belongs to.