• Overview
@angular/common

getLocaleDirection

function
deprecatedsince v18

Retrieves the writing direction of a specified locale

Deprecation warning

Angular recommends relying on the Intl API for i18n. For dates and numbers, let Intl.DateTimeFormat() and Intl.NumberFormat() determine the writing direction. The Intl alternative getTextInfo. has only partial support (Chromium M99 & Safari 17). 3rd party alternatives like rtl-detect can work around this issue.

API

function getLocaleDirection(locale: string): 'ltr' | 'rtl';
Jump to details