@phensley/locale
TypeScript icon, indicating that this package has built-in type declarations

1.8.0 • Public • Published

@phensley/locale

@phensley/locale min+gzip

Implements resolving of BCP 47 language tags by alias and likely subtags substitution.

Installation

NPM:

npm install --save @phensley/locale

Yarn:

yarn add @phensley/locale

Examples

import { LanguageResolver } from '@phensley/locale-resolver';

const IDS = ['en', 'es', 'es-419', 'und-AR', 'und-Hant', 'iw', 'i-klingon'];
for (const id of IDS) {
  const r = LanguageResolver.resolve(id);
  console.log(r.expanded());
}
en-Latn-US
es-Latn-ES
es-Latn-419
es-Latn-AR
zh-Hant-TW
he-Hebr-IL
tlh-Latn-US

Readme

Keywords

none

Package Sidebar

Install

npm i @phensley/locale

Weekly Downloads

1,416

Version

1.8.0

License

Apache-2.0

Unpacked Size

240 kB

Total Files

39

Last publish

Collaborators

  • phensley