Migrate to JS-Lingui for i18n
See original GitHub issueIssue
Description
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!
Direct Requirements
- Remove all i18next dependencies from
package.json
- Remove the i18next code from
src/config/i18n.js
- 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
Indirect Requirements
- Install JS-Lingui
- Add JS-Lingui CLI to the dev dependencies
- Create a npm task in the
package.json
file to use the CLI https://lingui.js.org/tutorials/cli.html
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top Results From Across the Web
[next] Misleading migration guide regarding i18n.load ... - GitHub
Describe the bug I'm getting a TypeScript error when using the method i18n.load. Probably something in my messages catalog is wrong, ...
Read more >Migration guide from 2.x to 3.x — LinguiJS documentation
NumberFormat and DateFormat components were removed. Import i18n from @lingui/core package and use i18n.date() and ì18n.number() instead.
Read more >lingui/js-lingui - Gitter
Hi, I'm exploring using lingui for node and was wondering if there's a way to get a translation without having to activate the...
Read more >Common i18n patterns in React — LinguiJS documentation
Using jsx macros is the most straightforward way how to translate your React components. <Trans> handles translations of messages including variables and other ......
Read more >lingui-i18n - npm
Start using lingui-i18n in your project by running `npm i ... See the migration guide for more info. ... github.com/lingui/js-lingui ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@tricoder42 that was a typo that completely changed the meaning of my message 😅
We are now using Lingui
I think Lingui is awesome!
Use the
localeDir
configuration to set the path tosrc/i18n
, then webpack should be able to load the files.https://lingui.js.org/ref/conf.html#localedir