iso-languages
Helpers for manipuling RFC4646 locales. Purpose is to have for each locale, the ISO639, ISO3166, ISO15924 and m49 references associated.
Installation
npm install iso-locales
ISO Locale
This library manages a collection of ISOLocale/s, completed with differents sources (see dependencies below). The main index is coming from: https://github.com/TiagoDanin/Windows-Locale
// return all locales;
You can search for a locale:
;;;;;...
RFC4646
LCID (RFC5646)
- Ref: https://docs.microsoft.com/en-us/windows/win32/intl/locale-identifiers
- Ref: https://docs.microsoft.com/en-us/windows/win32/intl/language-identifier-constants-and-strings
A language ID is a 16 bit value which is the combination of a primary language ID and a secondary language ID. The bits are allocated as follows:
+-----------------------+-------------------------+
| Sublanguage ID | Primary Language ID |
+-----------------------+-------------------------+
15 10 9 0 bit
A locale ID (LCID) is a 32 bit value which is the combination of a language ID, a sort ID, and a reserved area. The bits are allocated as follows:
+-------------+---------+-------------------------+
| Reserved | Sort ID | Language ID |
+-------------+---------+-------------------------+
31 20 19 16 15 0 bit
;;; ;
bcp-47 / RFC4646
- Ref: https://tools.ietf.org/html/bcp47, https://tools.ietf.org/html/rfc4646
- Dependency: https://github.com/wooorm/bcp-47
langtag = language
["-" script]
["-" region]
*("-" variant)
*("-" extension)
["-" privateuse]
ISO639 (Language)
- Ref: https://en.wikipedia.org/wiki/ISO_639
- Dependency: https://github.com/adlawson/langs.js
- Lists: https://fr.wikipedia.org/wiki/Liste_des_codes_ISO_639-1, https://www.loc.gov/standards/iso639-2/php/code_list.php
;;
ISO15924 (Script)
- Ref: https://en.wikipedia.org/wiki/ISO_15924
- Dependency: https://github.com/wooorm/iso-15924
- Lists: https://unicode.org/iso15924/iso15924-codes.html
;;
ISO3166 (Region/Country)
- Wikipedia: https://en.wikipedia.org/wiki/ISO_3166
- Dependency: https://github.com/nirvana-flame/countries-code
- Lists: https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes
;;
UN M49 (Region/Country)
- Ref: https://unstats.un.org/unsd/methodology/m49/, https://en.wikipedia.org/wiki/UN_M49
- Dependency: https://github.com/wooorm/un-m49
;;
MIT License
Copyright (c) 2020 Emmanuel Kimmerlin
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.