JavaScript i18n
Title
Subtitle
Features Title
Intl Api
Number Format
Date Time Format
Plural Rules
Message Format
Relative Time
List Format
Collator
Segmenter
Title
Description
// Using the built-in Intl API
const formatter = new Intl.NumberFormat('de-DE', {
style: 'currency',
currency: 'EUR',
});
console.log(formatter.format(1234.56)); // "1.234,56 €"
// Date formatting
const date = new Intl.DateTimeFormat('ja-JP', {
year: 'numeric',
month: 'long',
day: 'numeric',
});
console.log(date.format(new Date())); // "2026年3月2日"
// Pluralization
const plural = new Intl.PluralRules('en');
const suffixes = { one: 'st', two: 'nd', few: 'rd', other: 'th' };
function ordinal(n) {
return `${n}${suffixes[plural.select(n)]}`;
}