# windows-locale

> Windows Language Code Identifier (LCID) for JavaScript

Latest version **2.0.0** (published 2026-09-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install windows-locale
pnpm add windows-locale
yarn add windows-locale
bun add windows-locale
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2026-09-06 |
| First published | 2019-04-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18 |
| Dependencies | 0 |
| Unpacked size | 235.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Tiago Danin |
| Maintainers | tiagodanin |
| Keywords | code, i18n, language, languages, lcid, locale, locales, tag, windows |

## Links

- npm: https://www.npmjs.com/package/windows-locale
- Repository: https://github.com/TiagoDanin/Windows-Locale
- Homepage: https://TiagoDanin.github.io/Windows-Locale
- Issues: https://github.com/TiagoDanin/Windows-Locale/issues
- npm.io page: https://npm.io/package/windows-locale

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2026-09-06
- 1.1.3 — 2022-05-29
- 1.1.2 — 2020-05-25
- 1.1.1 — 2020-05-25
- 1.1.0 — 2020-05-24
- 1.0.1 — 2019-04-28
- 1.0.0 — 2019-04-28

## README

# Windows Locale

[![Node](https://img.shields.io/node/v/windows-locale.svg?style=flat-square)](https://npmjs.org/package/windows-locale) [![Version](https://img.shields.io/npm/v/windows-locale.svg?style=flat-square)](https://npmjs.org/package/windows-locale) [![Downloads](https://img.shields.io/npm/dt/windows-locale.svg?style=flat-square)](https://npmjs.org/package/windows-locale)

Windows Language Code Identifier (LCID) for JavaScript

## Installation

Module available through the [npm registry](https://www.npmjs.com/). It can be installed using the  [`npm`](https://docs.npmjs.com/getting-started/installing-npm-packages-locally) or [`yarn`](https://yarnpkg.com/en/) command line tools.

```sh
# NPM
npm install windows-locale --save
# Or Using Yarn
yarn add windows-locale
```

## Example

```js
import locale from 'windows-locale'
// Or using the named export
import { locales } from 'windows-locale'

console.log(locale['pt-br'])
/*
{
	language: 'Portuguese',
	location: 'Brazil',
	id: 1046,
	tag: 'pt-BR',
	version: 'Release A'
}
*/
```

> **CommonJS is still supported.** `const locale = require('windows-locale')`
> keeps working and returns the same data.

TypeScript types are bundled, the keys are checked at compile time:

```ts
import locale from 'windows-locale'

locale['pt-br'].language // string
locale['unknown'] // Type error
```

## Documentation

### `locale`
List of Languages

### `locale[language]`
Get Windows Language Code Identifier (LCID) information

- language (String)
- location (String || Null)
- id (Number)
- tag (String)
- version (String)

### Source
**NOTE:** Data is generated from the Microsoft **[MS-LCID]: Windows Language Code Identifier (LCID) Reference** specification, revision **16.0** (2024-04-23).

- Specification: [learn.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/70feba9f-294e-491e-b6eb-56532684c37f](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/70feba9f-294e-491e-b6eb-56532684c37f)
- PDF: [winprotocoldocs-bhdugrdyduf5h2e4.b02.azurefd.net/MS-LCID/%5bMS-LCID%5d.pdf](https://winprotocoldocs-bhdugrdyduf5h2e4.b02.azurefd.net/MS-LCID/%5bMS-LCID%5d.pdf)

To regenerate `index.json`, `index.d.ts`, `index.d.mts` and `index.mjs`, download the PDF above as `[MS-LCID].pdf` into the repository root and run:

```sh
yarn build
```

## Dependencies

None

## Dev Dependencies

- [pdf2json](https://ghub.io/pdf2json): A PDF file parser that converts PDF binaries to text based JSON, powered by porting a fork of PDF.JS to Node.js
- [standard](https://ghub.io/standard): JavaScript Standard Style

## Contributors

Pull requests and stars are always welcome. For bugs and feature requests, please [create an issue](https://github.com/TiagoDanin/Windows-Locale/issues). [List of all contributors](https://github.com/TiagoDanin/Windows-Locale/graphs/contributors).

## License

[MIT](LICENSE) © [Tiago Danin](https://TiagoDanin.github.io)

---
_Source: https://npm.io/package/windows-locale · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
