Socket
Socket
Sign inDemoInstall

rtl-detect

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    rtl-detect

Library will help you to detect if the locale is right-to-left language.


Version published
Weekly downloads
520K
increased by2%
Maintainers
1
Install size
26.3 kB
Created
Weekly downloads
 

Changelog

Source

1.1.2 (2023-10-24)

Bug Fixes

  • file name: fix CHANGELOG.md to be generated automatically (9a89bc7)

Readme

Source

rtl-detect

Build Status

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.

Keywords

FAQs

Last updated on 24 Oct 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc