Language Data
Contains code lists for ISO 639-1 and ISO 639-2 as well as multi-language support.
Friendly Reminder
We provided @iso-639/mapping (opens in a new tab) 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 (opens in a new tab)
Release Notes
Please refer to CHANGELOG (opens in a new tab) for details.