File: readme.md

package info (click to toggle)
node-lcid 1.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 108 kB
  • ctags: 7
  • sloc: makefile: 2; sh: 2
file content (35 lines) | stat: -rw-r--r-- 826 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# 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)

Based on the [mapping](https://github.com/python/cpython/blob/be2a1a76fa43bb1ea1b3577bb5bdd506a2e90e37/Lib/locale.py#L1395-L1604) used in the Python standard library.

The mapping itself is just a [JSON file](lcid.json) and can be used wherever.


## Install

```
$ npm install --save lcid
```


## Usage

```js
var lcid = require('lcid');

lcid.from(1044);
//=> 'nb_NO'

lcid.to('nb_NO');
//=> 1044

lcid.all;
//=> {'af_ZA': 1078, ...}
```


## License

MIT © [Sindre Sorhus](http://sindresorhus.com)