lcid
Advanced tools
Comparing version 1.0.0 to 2.0.0
11
index.js
'use strict'; | ||
var invertKv = require('invert-kv'); | ||
var all = require('./lcid.json'); | ||
var inverted = invertKv(all); | ||
const invertKv = require('invert-kv'); | ||
const all = require('./lcid.json'); | ||
exports.from = function (lcidCode) { | ||
const inverted = invertKv(all); | ||
exports.from = lcidCode => { | ||
if (typeof lcidCode !== 'number') { | ||
@@ -14,3 +15,3 @@ throw new TypeError('Expected a number'); | ||
exports.to = function (localeId) { | ||
exports.to = localeId => { | ||
if (typeof localeId !== 'string') { | ||
@@ -17,0 +18,0 @@ throw new TypeError('Expected a string'); |
{ | ||
"name": "lcid", | ||
"version": "1.0.0", | ||
"description": "Mapping between standard locale identifiers and Windows locale identifiers (LCID)", | ||
"license": "MIT", | ||
"repository": "sindresorhus/lcid", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=0.10.0" | ||
}, | ||
"scripts": { | ||
"test": "node test.js" | ||
}, | ||
"files": [ | ||
"index.js", | ||
"lcid.json" | ||
], | ||
"keywords": [ | ||
"lcid", | ||
"locale", | ||
"string", | ||
"str", | ||
"id", | ||
"identifier", | ||
"windows", | ||
"language", | ||
"lang", | ||
"map", | ||
"mapping", | ||
"convert", | ||
"json", | ||
"bcp47", | ||
"ietf", | ||
"tag" | ||
], | ||
"dependencies": { | ||
"invert-kv": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "0.0.4" | ||
} | ||
"name": "lcid", | ||
"version": "2.0.0", | ||
"description": "Mapping between standard locale identifiers and Windows locale identifiers (LCID)", | ||
"license": "MIT", | ||
"repository": "sindresorhus/lcid", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=6" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava" | ||
}, | ||
"files": [ | ||
"index.js", | ||
"lcid.json" | ||
], | ||
"keywords": [ | ||
"lcid", | ||
"locale", | ||
"string", | ||
"str", | ||
"id", | ||
"identifier", | ||
"windows", | ||
"language", | ||
"lang", | ||
"map", | ||
"mapping", | ||
"convert", | ||
"json", | ||
"bcp47", | ||
"ietf", | ||
"tag" | ||
], | ||
"dependencies": { | ||
"invert-kv": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "*", | ||
"xo": "*" | ||
} | ||
} |
# lcid [![Build Status](https://travis-ci.org/sindresorhus/lcid.svg?branch=master)](https://travis-ci.org/sindresorhus/lcid) | ||
> Mapping between [standard locale identifiers](http://en.wikipedia.org/wiki/Locale) and [Windows locale identifiers (LCID)](http://en.wikipedia.org/wiki/Locale#Specifics_for_Microsoft_platforms) | ||
> Mapping between [standard locale identifiers](https://en.wikipedia.org/wiki/Locale_(computer_software)) and [Windows locale identifiers (LCID)](http://en.wikipedia.org/wiki/Locale#Specifics_for_Microsoft_platforms) | ||
Based on the [mapping](https://github.com/python/cpython/blob/be2a1a76fa43bb1ea1b3577bb5bdd506a2e90e37/Lib/locale.py#L1395-L1604) used in the Python standard library. | ||
Based on the [mapping](https://github.com/python/cpython/blob/8f7bb100d0fa7fb2714f3953b5b627878277c7c6/Lib/locale.py#L1465-L1674) used in the Python standard library. | ||
@@ -13,3 +13,3 @@ The mapping itself is just a [JSON file](lcid.json) and can be used wherever. | ||
``` | ||
$ npm install --save lcid | ||
$ npm install lcid | ||
``` | ||
@@ -21,3 +21,3 @@ | ||
```js | ||
var lcid = require('lcid'); | ||
const lcid = require('lcid'); | ||
@@ -37,2 +37,2 @@ lcid.from(1044); | ||
MIT © [Sindre Sorhus](http://sindresorhus.com) | ||
MIT © [Sindre Sorhus](https://sindresorhus.com) |
Sorry, the diff of this file is not supported yet
6365
2
+ Addedinvert-kv@2.0.0(transitive)
- Removedinvert-kv@1.0.0(transitive)
Updatedinvert-kv@^2.0.0