Basic word-for-word string translation breaks down when handling grammatically complex linguistic rules. Different human languages possess completely different rules for pluralization (e.g. English has 2 plural forms, Arabic has 6, Japanese has 0), dynamic currency formatting, and localized calendar dates. Handling these correctly requires combining i18next with the native browser Intl API.
1. Enterprise Pluralization Rules
In English, pluralization is binary (1 item vs many items). In other languages (Russian, Polish, Arabic), nouns change forms based on specific numerical remainder patterns:
1// public/locales/en/common.json
2{
3"itemCount_one":"You have {{count}} item in your cart",
4"itemCount_other":"You have {{count}} items in your cart",
5"itemCount_zero":"Your shopping cart is completely empty"
6}
When invoking t(), pass count:
1// React automatically selects the correct linguistic plural form!
2<p>{t("itemCount",{ count: items.length })}</p>
2. Number and Currency Localization via Intl.NumberFormat
Never format currency with hardcoded dollar signs ($${amount}). Different countries format numbers differently (e.g. $1,250.50 in the US vs 1.250,50 € in Germany):