Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rtl-detect

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

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.

  • 1.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
450K
decreased by-25.01%
Maintainers
1
Weekly downloads
 
Created

What is rtl-detect?

The rtl-detect npm package is used to detect if a given language is written in a right-to-left (RTL) script. This can be useful for internationalization and localization purposes, especially when dealing with languages like Arabic, Hebrew, and Persian.

What are rtl-detect's main functionalities?

Detect if a language is RTL

This feature allows you to check if a given language code corresponds to a right-to-left language. In this example, 'ar' (Arabic) is checked and returns true.

const rtlDetect = require('rtl-detect');
const isRtl = rtlDetect.isRtlLang('ar');
console.log(isRtl); // true

Get list of RTL languages

This feature provides a list of all language codes that are written in a right-to-left script. This can be useful for dynamically adjusting UI elements based on the user's language.

const rtlDetect = require('rtl-detect');
const rtlLanguages = rtlDetect.getRtlLangs();
console.log(rtlLanguages); // ['ar', 'he', 'fa', ...]

Other packages similar to rtl-detect

Keywords

FAQs

Package last updated on 24 Oct 2023

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc