Skip to content

pantoken / renderers/web-components/src / getDir

Function: getDir()

getDir(localeOrBundle): "ltr" | "rtl"

Alpha

Return the text direction for a locale — using the LOCALES registry for known locales, falling back to "ltr" for unknown tags.

Parameters

localeOrBundle

string | LocaleBundle

Returns

"ltr" | "rtl"

Example

ts
getDir("ar"); // → "rtl"
getDir("hu"); // → "ltr"