kartotherian/language-scripts

Name: language-scripts

Owner: kartotherian

Description: Converts language code to script ID

Created: 2017-04-08 04:01:31.0

Updated: 2018-03-15 00:04:54.0

Pushed: 2018-03-15 00:04:53.0

Homepage: null

Size: 10

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Build Status

language-scripts

Converts language code to script ID

data

Maps language codes to scripts, as defined in CLDR unicode database. The object is a singleton, and should not be modified.

t lsdata = require('language-scripts').data;

ole.log(lsdata['en']); // ==> Latn
ole.log(lsdata['ru']); // ==> Cyrl

adjust(opts)

Clones data values, and can adjust key prefixes and add/remove values from the default.

t lsdata = require('language-scripts').adjust({
override: { 'be-tarask': 'Cyrl', 'fr': null},
prefix: 'name:'


ole.log(lsdata['name:en']);       // ==> Latn
ole.log(lsdata['name:be-tarsk']); // ==> Cyrl
ole.log(lsdata['name:fr']);       // ==> undefined

updating database

clone https://github.com/kartotherian/language-scripts.git
anguage-scripts
install
run init-cldr
run extract

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.