UNPKG

1.21 kBMarkdownView Raw
1# lcid [![Build Status](https://travis-ci.org/sindresorhus/lcid.svg?branch=master)](https://travis-ci.org/sindresorhus/lcid)
2
3> Mapping between [standard locale identifiers](https://en.wikipedia.org/wiki/Locale_(computer_software)) and [Windows locale identifiers (LCID)](https://en.wikipedia.org/wiki/Locale#Specifics_for_Microsoft_platforms)
4
5Based on the [mapping](https://github.com/python/cpython/blob/8f7bb100d0fa7fb2714f3953b5b627878277c7c6/Lib/locale.py#L1465-L1674) used in the Python standard library.
6
7The mapping itself is just a [JSON file](lcid.json) and can be used anywhere.
8
9
10## Install
11
12```
13$ npm install lcid
14```
15
16
17## Usage
18
19```js
20const lcid = require('lcid');
21
22lcid.from(1044);
23//=> 'nb_NO'
24
25lcid.to('nb_NO');
26//=> 1044
27
28lcid.all;
29//=> {'af_ZA': 1078, …}
30```
31
32
33---
34
35<div align="center">
36 <b>
37 <a href="https://tidelift.com/subscription/pkg/npm-lcid?utm_source=npm-lcid&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
38 </b>
39 <br>
40 <sub>
41 Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
42 </sub>
43</div>