Loading...
const label = 'You have ' + count + ' items';
const price = '$' + amount.toFixed(2);const label = t('cart.items', { count });
const price = new Intl.NumberFormat(locale, {
style: 'currency',
currency: 'USD',
}).format(amount);Translation keys handle plural rules per language, and Intl.NumberFormat places the currency symbol and separators for the locale.
Intl, not by concatenating strings.i18n prepares the code to support many languages and regions, while l10n translates and adapts the content for one specific locale.
There are 18 letters between the first 'i' and the last 'n' in 'internationalization'.
Set dir='rtl' on <html> for those locales and use logical CSS properties like margin-inline-start instead of left and right.