Pluralisation & Interpolation
Handle count-based plural forms and insert dynamic values into translated strings.
Welcome
In this lesson you will handle count-based plural forms and insert dynamic values into translated strings using i18next interpolation and plural support.
Interpolation Basics
Use double curly braces in your translation strings as placeholders. Pass an object with the variable values as the second argument to t().
// JSON: "greeting": "Hello, {{name}}!"
t('greeting', { name: 'Alice' }); // Hello, Alice!All lessons in this course
- Setting Up react-i18next
- Using the useTranslation Hook
- Pluralisation & Interpolation
- Language Switcher & Lazy-Loading Translations