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:


This content originally appeared on DEV Community and was authored by John B

package

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!


This content originally appeared on DEV Community and was authored by John B


Print Share Comment Cite Upload Translate Updates
APA

John B | Sciencx (2021-08-20T15:40:53+00:00) I18n and React, a simple and easy solution. Retrieved from https://www.scien.cx/2021/08/20/i18n-and-react-a-simple-and-easy-solution/

MLA
" » I18n and React, a simple and easy solution." John B | Sciencx - Friday August 20, 2021, https://www.scien.cx/2021/08/20/i18n-and-react-a-simple-and-easy-solution/
HARVARD
John B | Sciencx Friday August 20, 2021 » I18n and React, a simple and easy solution., viewed ,<https://www.scien.cx/2021/08/20/i18n-and-react-a-simple-and-easy-solution/>
VANCOUVER
John B | Sciencx - » I18n and React, a simple and easy solution. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/08/20/i18n-and-react-a-simple-and-easy-solution/
CHICAGO
" » I18n and React, a simple and easy solution." John B | Sciencx - Accessed . https://www.scien.cx/2021/08/20/i18n-and-react-a-simple-and-easy-solution/
IEEE
" » I18n and React, a simple and easy solution." John B | Sciencx [Online]. Available: https://www.scien.cx/2021/08/20/i18n-and-react-a-simple-and-easy-solution/. [Accessed: ]
rf:citation
» I18n and React, a simple and easy solution | John B | Sciencx | https://www.scien.cx/2021/08/20/i18n-and-react-a-simple-and-easy-solution/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.