I'm working on a small web application in React and I want it to be in two languages. I've seen several localization libraries like react-i18next
and react-intl
but I'm hesitant to install something maybe too big for such a simple application. Is there a lightweight library to do simple localization or should I look into a more straightforward approach like a string replacing component?
Thanks!
If it is a small project you probably do not need it.
However, it would be a really good experience to write your own localization component, integrate it with redux
and opensource it. Also, there are some simplified versions already available so you can reuse it and/or contribute into. Here is a simple react-localization implementation.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.