Detect if a locale is RTL, using Intl if possible
npm install rtl-detect-intlThis is a fork of rtl-detect that uses the browser/node Intl API if possible: Locale.getTextInfo()
js
var rtlDetect = require('rtl-detect-intl');
`$3
This function will check if the locale is right-to-left language or not.Examples:
`js
var isRtl = rtlDetect.isRtlLang('ar-JO');
// isRtl will be true
``js
var isRtl = rtlDetect.isRtlLang('ar_JO');
// isRtl will be true
``js
var isRtl = rtlDetect.isRtlLang('ar');
// isRtl will be true
``js
var isRtl = rtlDetect.isRtlLang('en-US');
// isRtl will be false
`$3
This function will get language direction for the locale.Examples:
`js
var langDir = rtlDetect.getLangDir('ar-JO');
// langDir will be 'rtl'
``js
var langDir = rtlDetect.getLangDir('ar_JO');
// langDir will be 'rtl'
``js
var langDir = rtlDetect.getLangDir('ar');
// langDir will be 'rtl'
``js
var langDir = rtlDetect.getLangDir('en-US');
// langDir will be 'ltr'
``Copyright 2015, Yahoo! Inc.