Intl.Locale.prototype.textInfo

The textInfo accessor property of Intl.Locale instances returns the ordering of characters indicated by either ltr (left-to-right) or by rtl (right-to-left) for this locale.

Description

Returns the Locale information associated with the Locale data specified in UTS 35's Layouts Elements.

Examples

Obtaining text info

Return the supported text directions for a given Locale.

const ar = new Intl.Locale("ar");
console.log(ar.textInfo); // { direction: "rtl" }
console.log(ar.textInfo.direction); // "rtl"
const es = new Intl.Locale("es");
console.log(es.textInfo); // { direction: "ltr" }
console.log(es.textInfo.direction); // "ltr"

Specifications

Specification
Intl Locale Info Proposal
# sec-Intl.Locale.prototype.textInfo

Browser compatibility

BCD tables only load in the browser

See also