ilc

iso-language-converter

Converter between different ISO 639 language tags

Showing:

Popularity

Downloads/wk

969

GitHub Stars

1

Maintenance

Last Commit

5yrs ago

Contributors

1

Package

Dependencies

0

Size (min+gzip)

9.5KB

License

MIT

Type Definitions

Tree-Shakeable

Yes?

Categories

Readme

iso-language-converter Build Status

Converter between different ISO 639 language tags.

The list of codes is taken by Wikipedia, while the default scripts for each language is taken from this table.

Install

npm install --save iso-language-converter

Usage

var isoConv = require('iso-language-converter');

isoConv('ita'); // Italian
isoConv('it'); // Italian
isoConv('Italian'); // it

isoConv('it', {from: 1, to: 'label'}); // Italian
isoConv('ita', {from: 2, to: 1}); // it

isoConv('it', {from: 'label'}); // Italian
isoConv('ita', {from: 1}); // it

isoConv('it', {to: 'script'}); // 'Latn'
isoConv('ho', {to: 'script'}); // undefined

API

isoConv(input, [options])

input

Type: string

The code of the language in one of the ISO 639 form -or- the English name for the language.

options

Type: object

Options for the converter:

{
  // number of ISO 639 from 1 to 5, or 'label'
  // if not specified, guess on the input
  from: 1,

  // number of ISO 639 from 1 to 5, 'label' or 'script'
  // if not specified, guess on the input
  to: 'label',

  // return an ISO 639-5 if the requested ISO is not present (not valid with to:'label')
  // default: false
  fallback: false
}

License

MIT

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100