The onlanguagechange property of the WorkerGlobalScope interface represents an EventHandler to be called when the languagechange event occurs and bubbles through the Worker.
Syntax
self.onlanguagechange = function() { ... };
Example
The following code snippet shows an onlanguagechange handler set inside a worker:
self.onlanguagechange = function() {
console.log('Your preferred language settings have been changed');
}
Specifications
| Specification | Status | Comment |
|---|---|---|
| HTML Living Standard The definition of 'WorkerGlobalScope.onlanguagechange' in that specification. |
Living Standard |
Browser compatibility
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.
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
onlanguagechange | Chrome Full support 4 | Edge Full support 12 | Firefox Full support 74 | IE Full support Yes | Opera Full support 11.5 | Safari Full support 4 | WebView Android Full support 37 | Chrome Android Full support 40 | Firefox Android No support No | Opera Android Full support Yes | Safari iOS Full support 5.1 | Samsung Internet Android Full support 4.0 |
Legend
- Full support
- Full support
- No support
- No support
See also
The WorkerGlobalScope interface it belongs to.
