Window: languagechange event

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

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

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.

Event handler aliases

In addition to the Window interface, the event handler property onlanguagechange is also available on the following targets:

Examples

You can use the languagechange event in an addEventListener method:

js
window.addEventListener("languagechange", () => {
  console.log("languagechange event detected!");
});

Or use the onlanguagechange event handler property:

js
window.onlanguagechange = (event) => {
  console.log("languagechange event detected!");
};

Specifications

Specification
HTML
# event-languagechange
HTML
# handler-window-onlanguagechange

Browser compatibility

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
languagechange event

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

See also