WorkerGlobalScope: languagechange event

The languagechange event is fired at the global scope object when the user's preferred language changes.

Bubbles No
Cancelable No
Interface Event
Event handler onlanguagechange

Examples

You can use the languagechange event in an addEventListener method:

worker.addEventListener('languagechange', function() {
  console.log('languagechange event detected!');
});

Or use the onlanguagechange event handler property:

worker.onlanguagechange = function(event) {
  console.log('languagechange event detected!');
};

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
languagechange_event
4
12
74
Yes
11.5
4
≤37
40
No
Yes
5
4.0

See also

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/languagechange_event