// Test all getters return the expected results. var langtag = "de-latn-de-u-ca-gregory-co-phonebk-hc-h23-kf-true-kn-false-nu-latn"; var loc = new Intl.Locale(langtag);
assert.sameValue(loc.toString(), "de-Latn-DE-u-ca-gregory-co-phonebk-hc-h23-kf-kn-false-nu-latn"); assert.sameValue(loc.baseName, "de-Latn-DE"); assert.sameValue(loc.language, "de"); assert.sameValue(loc.script, "Latn"); assert.sameValue(loc.region, "DE"); assert.sameValue(loc.calendar, "gregory"); assert.sameValue(loc.collation, "phonebk"); assert.sameValue(loc.hourCycle, "h23"); if ("caseFirst" in loc) { assert.sameValue(loc.caseFirst, "");
} if ("numeric" in loc) { assert.sameValue(loc.numeric, false);
} assert.sameValue(loc.numberingSystem, "latn");
// Replace all components through option values and validate the getters still // return the expected results. var loc = new Intl.Locale(langtag, {
language: "ja",
script: "jpan",
region: "jp",
calendar: "japanese",
collation: "search",
hourCycle: "h24",
caseFirst: "false",
numeric: "true",
numberingSystem: "jpanfin",
});
assert.sameValue(loc.toString(), "ja-Jpan-JP-u-ca-japanese-co-search-hc-h24-kf-false-kn-nu-jpanfin"); assert.sameValue(loc.baseName, "ja-Jpan-JP"); assert.sameValue(loc.language, "ja"); assert.sameValue(loc.script, "Jpan"); assert.sameValue(loc.region, "JP"); assert.sameValue(loc.calendar, "japanese"); assert.sameValue(loc.collation, "search"); assert.sameValue(loc.hourCycle, "h24"); if ("caseFirst" in loc) { assert.sameValue(loc.caseFirst, "false");
} if ("numeric" in loc) { assert.sameValue(loc.numeric, true);
} assert.sameValue(loc.numberingSystem, "jpanfin");
// Replace only some components through option values and validate the getters // return the expected results. var loc = new Intl.Locale(langtag, {
language: "fr",
region: "ca",
collation: "standard",
hourCycle: "h11",
});
assert.sameValue(loc.toString(), "fr-Latn-CA-u-ca-gregory-co-standard-hc-h11-kf-kn-false-nu-latn"); assert.sameValue(loc.baseName, "fr-Latn-CA"); assert.sameValue(loc.language, "fr"); assert.sameValue(loc.script, "Latn"); assert.sameValue(loc.region, "CA"); assert.sameValue(loc.calendar, "gregory"); assert.sameValue(loc.collation, "standard"); assert.sameValue(loc.hourCycle, "h11"); if ("caseFirst" in loc) { assert.sameValue(loc.caseFirst, "");
} if ("numeric" in loc) { assert.sameValue(loc.numeric, false);
} assert.sameValue(loc.numberingSystem, "latn");
reportCompare(0, 0);
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.15 Sekunden
(vorverarbeitet am 2026-06-10)
¤
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.