Format dates, numbers and lists with Intl
8 steps · about 2 h 34 min · Intermediate
- Understand the internationalization namespace (guide, MDN Web Docs, 22 min)
Learn the shared locale negotiation and options model behind the formatter classes.
- Canonicalize requested locales (reference, MDN Web Docs, 14 min)
Normalize locale identifiers before storing preferences or constructing formatters.
- Format dates with an explicit zone (reference, MDN Web Docs, 24 min)
Avoid machine-dependent date output by declaring the intended date fields and time zone.
- Format numbers, currency and units (reference, MDN Web Docs, 24 min)
Apply locale-aware separators, precision, currency and unit display without string surgery.
- Express relative time (reference, MDN Web Docs, 18 min)
Produce phrases such as yesterday or in two weeks with the locale's grammar.
- Join human-readable lists (reference, MDN Web Docs, 16 min)
Use locale-appropriate conjunctions and punctuation for dynamic item lists.
- Select plural message branches (reference, MDN Web Docs, 18 min)
Separate plural-category selection from translated message text instead of assuming singular and plural only.
- Inspect locale capabilities (reference, MDN Web Docs, 18 min)
Resolve language, script, region, calendar and numbering preferences without parsing tags by hand.