Intl.Locale.prototype.collations accessor property returns a list of one or more collation types for the
Collation is the process of ordering strings of characters. It is used whenever strings must be sorted and placed into a certain order, from search query results to ordering records in a database. While the idea of placing strings in order might seem trivial, the idea of order can vary from region to region and language to language. The
collations property returns an array of all collation types commonly used for the
Locale, sorted in alphabetical order, with the
search values always excluded. If the
Locale already has a
collation, then the returned array contains that single value.
Below is a list of the supported collation types, adapted from the Unicode collation specification.
Supported collation types
Pinyin ordering for Latin, big5 charset ordering for CJK characters (for Chinese)
big5hancollation type is deprecated, not available in Firefox, Chrome or Edge.
A previous version of the ordering, for compatibility (for Arabic)
Dictionary style ordering (for Sinhala)
Binary code point order
directcollation type has been deprecated. Do not use.
The default Unicode collation element table order
ducetcollation type is not available to the Web. Use the
undlocale without a collation type specifier instead.
undis the collation that is the closest to
Recommended ordering for emoji characters (for the
European ordering rules (for the
Pinyin ordering for Latin, gb2312han charset ordering for CJK characters (for Chinese)
gb2312collation type is deprecated, not available in Firefox, Chrome or Edge.
Phonebook style ordering (for German)
Phonetic ordering (sorting based on pronunciation; for Lingala)
Pinyin ordering for Latin and for CJK characters (for Chinese)
Reformed ordering (formerly for Swedish)
Warning: Do not use explicitly. This is the old name for the default ordering for Swedish whose collation naming used to differ from other languages. Since this was the default, request
svinstead of requesting
Special collation type for string search
Warning: Do not use. In
Intl.Collator, this collation is activated via the
searchvalue for the
usageoption. Furthermore, there is currently no API for actually using the collator for search.
Special collation type for Korean initial consonant search
Warning: Do not use. This collation is meant for searching, but
Intl.Collatorprovides an API only for sorting.
Default ordering for each language, except Chinese (and, previously, Swedish)
Warning: Do not use explicitly. In general, it's unnecessary to specify this explicitly and specifying this for Swedish is problematic in case the naming of the Swedish collations is changed to be consistent with other languages in the future.
Pinyin ordering for Latin, stroke order for CJK characters (for Chinese)
Traditional style ordering (such as in Spanish)
Radical-stroke ordering for Han characters (for Chinese, Japanese, and Korean). Pinyin ordering for Latin in the case of Chinese.
unihancollation type is not available in Chrome or Edge.
Pinyin ordering for Latin, zhuyin order for Bopomofo and CJK characters (for Chinese)
Obtaining supported collation types
Locale object doesn't have a
collation already, the
collations property lists all commonly-used collation types for the given
Locale. For examples of explicitly setting a
const locale = new Intl.Locale("zh"); console.log(locale.collations); // ["pinyin", "stroke", "zhuyin", "emoji", "eor"]
|Intl Locale Info Proposal |
BCD tables only load in the browser