This page is Almost Ready

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

locale

Summary

Gets the locale name (language code, e.g., "en-US", "fr", "de", "ja", etc.) for the composition event, if available; otherwise, the empty string.

Property of dom/CompositionEventdom/CompositionEvent

Syntax

Note: This property is read-only.

var localeName = event.locale;

Return Value

Returns an object of type StringString

The locale of the event.

Examples

function getLocale(e) {
//retrieve locale string for composition event
var localeString = e.locale;
return localeString;
}

Notes

For trusted events, the locale property is set for keyboard and Input Method Editor (IME) input only. The locale name is set from the default LCID of the thread, en-US, for example.

See also

Related pages

Attributions