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

intl-locale-textinfo-polyfill

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

intl-locale-textinfo-polyfill

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

  • 2.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
976
decreased by-9.38%
Maintainers
1
Weekly downloads
 
Created
Source

intl-locale-textinfo-polyfill

This library will help you to detect if the locale is right-to-left language or not.

It implements part of this now Stage 3 intl-locale-info proposal.

The library has begun as a fork of rtl-detect, but it strives to adhere to the Intl.Locale (textInfo) proposal (notably, locales with underscores as in the form en_US are not accepted).

Usage

import the library as a ponyfill

import Locale from 'intl-locale-textinfo-polyfill';

const { direction } = new Locale('he').textInfo;
// "rtl"

import the library as a polyfill

import 'intl-locale-textinfo-polyfill/lib/polyfill.js';

const { direction } = new Intl.Locale('he').textInfo;
// `direction` will be "rtl"

Intl.Locale#textInfo

This returns an object with the language direction for the locale.

Examples:

const { direction } = new Intl.Locale('ar-JO').textInfo;
// `direction` will be "rtl"
const { direction } = new Intl.Locale('ar').textInfo;
// `direction` will be "rtl"
const { direction } = new Intl.Locale('en-US')).textInfo;
// `direction` will be "ltr"

Keywords

FAQs

Package last updated on 29 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