These constructors handle phrases that string concatenation gets wrong in most languages. PluralRules (ECMA-402
returns a plural category (zero, one, two, few, many, other). RelativeTimeFormat and Locale
arrived in 2020, ListFormat and DisplayNames (names of languages, regions and currencies) in 2021, Segmenter in 2022 and DurationFormat in 2025.
const pr = new Intl.PluralRules('en', { type: 'ordinal' });
const suffix = { one: 'st', two: 'nd', few: 'rd', other: 'th' };
console.log([1, 2, 3, 4, 11, 22].map((n) => n + suffix[pr.select(n)]).join(' '),
new Intl.PluralRules('ar').select(3), new Intl.PluralRules('ja').select(3));
const rtf = new Intl.RelativeTimeFormat('en', { numeric: 'auto' });
console.log(rtf.format(-1, 'day'), '|', rtf.format(3, 'week'),
'|', new Intl.RelativeTimeFormat('es').format(-2, 'hour'));
console.log(new Intl.ListFormat('en', { type: 'disjunction' }).format(['tea', 'coffee', 'juice']),
'|', new Intl.ListFormat('de').format(['Tee', 'Kaffee', 'Saft']));
const seg = new Intl.Segmenter('ja', { granularity: 'word' });
console.log([...seg.segment('吾輩は猫である')].filter((s) => s.isWordLike).map((s) => s.segment));
const names = new Intl.DisplayNames('fr', { type: 'region' });
console.log(names.of('JP'), new Intl.DisplayNames('en', { type: 'language' }).of('zh-Hant'));
const run = { hours: 1, minutes: 46, seconds: 40 };
console.log(new Intl.DurationFormat('en', { style: 'long' }).format(run),
'|', new Intl.DurationFormat('fr', { style: 'digital' }).format(run));
const loc = new Intl.Locale('zh', { region: 'TW' }).maximize();
console.log(loc.toString(), loc.script, new Intl.Locale('en-US').getWeekInfo());1st 2nd 3rd 4th 11th 22nd few other
yesterday | in 3 weeks | hace 2 horas
tea, coffee, or juice | Tee, Kaffee und Saft
[ '吾輩', 'は', '猫', 'で', 'ある' ]
Japon Traditional Chinese
1 hour, 46 minutes, 40 seconds | 1:46:40
zh-Hant-TW Hant { firstDay: 7, weekend: [ 6, 7 ] }Segmenter finds words in Japanese, Chinese and Thai, which use no spaces, and counts user-perceived characters with granularity: 'grapheme' (Tagged Templates). DurationFormat is Baseline since March 2025, but getWeekInfo() and the other Locale info methods reached all major browsers only in July 2026, so feature-test them.