Skip to content

pantoken-root / 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"