// Collation can be set as Unicode locale extension or as a property.
{
let c1 = new Intl.Collator("de", {usage: "sort"});
let c2 = new Intl.Collator("de", {usage: "sort", collation: "phonebk"});
let c3 = new Intl.Collator("de-u-co-phonebk", {usage: "sort"});
// Collation property overrides any Unicode locale extension.
{
let c1 = new Intl.Collator("de-u-co-eor", {usage: "sort"});
let c2 = new Intl.Collator("de-u-co-eor", {usage: "sort", collation: "phonebk"});
// Ensure "eor" collation is supported.
assertEq(c1.resolvedOptions().locale, "de-u-co-eor");
assertEq(c1.resolvedOptions().collation, "eor");
// The default sort collation can't be requested.
{ // The default sort collation for Swedish (sv) was "reformed" before CLDR 42. // It wasn't possible to override this and select the default root sort // collation. Use English (en) as a locale which uses the root sort collation // for comparison.
let c1 = new Intl.Collator("sv", {usage: "sort"});
let c2 = new Intl.Collator("sv-u-co-reformed", {usage: "sort"});
let c3 = new Intl.Collator("sv-u-co-standard", {usage: "sort"});
let c4 = new Intl.Collator("sv-u-co-default", {usage: "sort"});
let c5 = new Intl.Collator("en", {usage: "sort"});
// Search collations ignore any collation overrides.
{
let c1 = new Intl.Collator("de", {usage: "search"});
let c2 = new Intl.Collator("de", {usage: "search", collation: "phonebk"});
let c3 = new Intl.Collator("de-u-co-phonebk", {usage: "search"});
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.