Luckily, the intl library provides the Collator class ( and shadow functions with names starting with collator_), which you can use to compare and sort strings with respect to your selected locale. 所幸的是,intl库提供了Collator类(以及名字以collator开头的影子函数),可用来根据特定的locale对比和排序字符串。
This collator ensures all characters, supplementary and non-supplementary, have the same binary collating sequence as UTF-8. 这个排序器确保所有字符(补充字符和非补充字符)采用与UTF-8一样的二进制排序次序。
The Spanish collator used the less-than sign. 西班牙语排序器使用了小于号。
And at the end, a Czech collator is used. 最后,使用了一个针对捷克语的collator。
The first custom collator is one to sort Spanish words. 第一个自定义排序器用于排序西班牙语单词。
IDENTITY collator implements the character comparison based on the code point. IDENTITY排序器实现基于编码点的字符比较。