If you want to translate your Single Page Application to other languages without much hassle - this short guide might be for you.
Internationalization (i18n for short) is not a trivial topic and it is perfectly fine to avoid it unless you need it 😎
At SwissDev Jobs we came to the point where we would like to not only have an English version of our website but also German, French and perhaps Italian (Switzerland has 4 languages to support).
I18n is a new topic for us, so we started researching how to do it in a React application with 2 criteria in mind:
- Easy learning curve - we do NOT want to spend next 4 weeks learning a new framework or library but want a solution that works NOW
- Minimal impact on performance - adding i18n should not blow our bundle size or make the app slower
During the research, we quickly noticed that the existing popular frameworks do not met those requirements.
As we continued our research, we asked ourselves - what is really needed for supporting multiple languages and then it struck us:
Of course, you can put the actual translations in separate files but you get the idea.
This way you have created your own, super-simple i18n service 🌍