Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@iso-639/data

ISO-63932MIT0.2.0

Contains code lists for ISO 639-1 and ISO 639-2 as well as multi-language support.

iso-639, iso-639-1, iso-639-2, language, language code, language json, language data, language mapping, locale, locale code, i18n, i18n code

readme

@iso-639/data

GitHub stars

Contains code lists for ISO 639-1 and ISO 639-2 as well as multi-language support.

Friendly Reminder

We provided @iso-639/mapping mapping toolkit, which can easily help you manage language data.

Usage

With npm(or yarn, or pnpm):

npm install @iso-639/data

In .js / .ts or other files:

// ISO 639-1 is stored in the `1` directory
import ISO_639_1_EN from '@iso-639/data/1/en.json'
import ISO_639_1_ZH_CN from '@iso-639/data/1/zh-CN.json'

// ISO 639-2 is stored in the `2` directory
import ISO_639_2_EN from '@iso-639/data/2/en.json'
import ISO_639_2_ZH_CN from '@iso-639/data/2/zh-CN.json'

With CDN:

<script>
  const res = await fetch('https://cdn.jsdelivr.net/npm/@iso-639/data/1/en.json')
  const json = await res.json()
</script>

Multi-language Support

JSON files named with language codes in the source code directory are supported languages.

See: Source Code

Release Notes

Please refer to CHANGELOG for details.

License

MIT License © 2023-PRESENT chengpeiquan