demo · v130

Text Direction via getTextInfo()

Chrome 130 promotes Intl.Locale info from getter properties to explicit methods. locale.getTextInfo() returns { direction: 'ltr' | 'rtl' } — the canonical text flow direction for any BCP-47 locale tag.

Note: Intl.Locale.prototype.getTextInfo is not available in this browser. The direction values below are computed from a fallback lookup table. Upgrade to Chrome 130+ to use the live API.

locale picker

getTextInfo()
direction ltr
locale in own language

sample text

text rendered with computed direction

all 15 locales at a glance

locale tag language (own name) direction getTextInfo() result

the code

// Chrome 130+ — getTextInfo() as an explicit method
const locale = new Intl.Locale('ar-SA');
locale.getTextInfo();
// → { direction: 'rtl' }

const dir = locale.getTextInfo().direction; // 'rtl'

// Apply to a DOM element
document.getElementById('content').dir = dir;

// Example: English
new Intl.Locale('en-US').getTextInfo();
// → { direction: 'ltr' }

see also