WorkerGlobalScope: languagechange event
Note: This feature is only available in Web Workers.
The languagechange
event is fired at the global scope object when the user's preferred language changes.
This event is not cancelable and does not bubble.
Syntax
Use the event name in methods like addEventListener()
, or set an event handler property.
js
addEventListener("languagechange", (event) => {});
onlanguagechange = (event) => {};
Event type
A generic Event
.
Examples
You can use the languagechange
event in an addEventListener
method:
js
worker.addEventListener("languagechange", () => {
console.log("languagechange event detected!");
});
Or use the onlanguagechange
event handler property:
js
worker.onlanguagechange = (event) => {
console.log("languagechange event detected!");
};
Specifications
Specification |
---|
HTML # event-languagechange |
HTML # handler-workerglobalscope-onlanguagechange |
Browser compatibility
Report problems with this compatibility data on GitHubdesktop | mobile | server | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
languagechange event |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.