An Interest In:
Web News this Week
- April 26, 2024
- April 25, 2024
- April 24, 2024
- April 23, 2024
- April 22, 2024
- April 21, 2024
- April 20, 2024
I18n and React, a simple and easy solution
Internationalization can be a headache and is oftentimes heavy; both in terms of code size and overhead.
With this in mind, I wrote a very simple, lightweight package for react (7.1kB minified, no dependencies).
Unconventional features:
Backend independent
It can be linked to any backend. I assume here that the list of translations is stored somewhere on the internet (typically served from the backend).
Once loaded, the list of translations is stored in the local storage so that the application can be reloaded quickly.
Untranslated strings
I have always found it hard to know which strings were translated and which were not. With this package, we store all the untranslated strings in an array in the local storage, so that you can see at anytime all the missing strings - all you need to do is browse through the application.
Features
n
languages- string interpolation
- typescript
- 0 dependencies
- Built with react in mind, but can be used with any JS framework.
Get it!
- Github: https://github.com/nexys-system/react-i18n
- NPM:
Original Link: https://dev.to/johnb8005/i18n-and-react-a-simple-and-easy-solution-3403
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To