i18n
What is it
Process for developers to prepare software products for localization
Localization
is adapting a web products to a customer base in a different region
i18next.t()
vs <Trans>
- Use
<Trans>
when you want to use html tags like<strong>
around the text and still have it translated
Interpolation (dynamic values)
Allows dynamic values into your translations
// key { "key": "{{what}} is {{how}}" } // usage i18next.t('key', {what: 'i18next', how: 'great'});
Example
"key": "I am {{author.name}}" // naming convention "repository.domain.component.text_content": "Dynamic string is: {{ textContent }}" // usage const author = { name: 'Jan', github: 'jamuhl' }; i18next.t('key', {author});