I\'m setting up a static website which I want to display in two languages.
I can\'t find a comprehensive overview of the different options (e.g. server-side loading vs
I don't think you need to bother with a library at all if all you are doing is text translation. All you need to do is write a simple function which switches between two (or more) json language files and a mechanism to display the right string from the selected json file.
For anyone else looking around, I found an overview on this Reddit thread. I'll also explain the option I went with below.
1) Front-End JS (e.g. jquery.i18n)
2) Multiple Pages
3) Server Side (e.g. node-i18n)
4) Using a build tool like npm scripts or gulp (e.g. static-i18n)
In the end I went with option 4 using static-i18n. While it took a bit of setting up, it works well for SEO, works for static sites, is easily maintainable, is scalable, and avoids the messiness of front-end dynamic language loading.