• Overview
@angular/common

getLocaleDirection

function
Deprecated

Retrieves the writing direction of a specified locale

  
    function getLocaleDirection(  locale: string): "ltr" | "rtl";
  
  

getLocaleDirection

"ltr" | "rtl"

Retrieves the writing direction of a specified locale

@deprecated

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.

@paramlocalestring

A locale code for the locale format rules to use.

@returns"ltr" | "rtl"
Jump to details