Package Exports
- rtl-detect
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (rtl-detect) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
rtl-detect
This library will help you to detect if the locale is right-to-left language or not.
Usage
require rtl-detect lib
var rtlDetect = require('rtl-detect');
isRtlLang
This function will check if the locale is right-to-left language or not.
Examples:
var isRtl = rtlDetect.isRtlLang('ar-JO');
// isRtl will be true
var isRtl = rtlDetect.isRtlLang('ar_JO');
// isRtl will be true
var isRtl = rtlDetect.isRtlLang('ar');
// isRtl will be true
var isRtl = rtlDetect.isRtlLang('en-US');
// isRtl will be false
getLangDir
This function will get language direction for the locale.
Examples:
var langDir = rtlDetect.getLangDir('ar-JO');
// langDir will be 'rtl'
var langDir = rtlDetect.getLangDir('ar_JO');
// langDir will be 'rtl'
var langDir = rtlDetect.getLangDir('ar');
// langDir will be 'rtl'
var langDir = rtlDetect.getLangDir('en-US');
// langDir will be 'ltr'
Copyright 2015, Yahoo! Inc.