Other Intl Formatters

PluralRules, RelativeTimeFormat, ListFormat, Segmenter, DisplayNames, DurationFormat and Locale

These constructors handle phrases that string concatenation gets wrong in most languages. PluralRules (ECMA-402

  1. 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.

Plurals, relative times, lists, word segments, display names, durations and localesJavaScriptLive
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());

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.