Migrate to JS-Lingui for i18nSee original GitHub issue
JS-Lingui is a relative new library for internationalization, the API is very similar to React18next, in fact the author decided to do this in order to easily migrate from other libraries.
It supports plurals as well as custom formatting for texts. The most important thing is that this library comes with a CLI that we can use to manage the keys/text in all the different languages that we will support.
When it comes to manage the translations, it’s near impossible to find out which keys are unused/missing without an automated tool. JS-Lingui alleviates this pain, by providing a CLI that we can use in development.
Finally, this library adds a few KB to the final build which is great for performance!
- Remove all i18next dependencies from
- Remove the i18next code from
- Setup JS-Lingui https://lingui.js.org/tutorials/react.html
- Using the CLI add the two languages that we support (en, fr)
- Migrate the existing translations in the components that we have
- Install JS-Lingui
- Add JS-Lingui CLI to the dev dependencies
- Create a npm task in the
package.jsonfile to use the CLI https://lingui.js.org/tutorials/cli.html
- Created 5 years ago
- Comments:8 (4 by maintainers)