Format dates, numbers and currency in the reader's locale with Intl.
From web-design-guidelines (Web Interface Guidelines).
Switch the locale; only the right invoice follows.
"$" + n.toFixed(2)`${mm}/${dd}/${yyyy}`Intl.NumberFormat(locale, { style: "currency", currency })const money = new Intl.NumberFormat(locale, { style: "currency", currency });
const pct = new Intl.NumberFormat(locale, { style: "percent" });
const date = new Intl.DateTimeFormat(locale, { dateStyle: "medium" });
Pick a reader and where they connect from.
const SUPPORTED = ["en", "de", "fr", "ja", "pt"];
const ui = navigator.languages
.map((tag) => tag.split("-")[0])
.find((lang) => SUPPORTED.includes(lang)) ?? "en";
const when = new Intl.DateTimeFormat(navigator.languages[0], {
dateStyle: "full",
timeStyle: "short",
});
Press Translate, then type a product name like Plaid.
<p>Connect <span translate="no">Stripe</span>, post alerts to <span translate="no">Slack</span> …</p>
<p>Then call <code translate="no">useState</code> and run <code translate="no">npm run build</code>.</p>
03/04/2026 is March 4 in the US and April 3 elsewhere.
navigator.languages survives VPNs and travel.