While building websites for multiple locales, Do you create new websites altogether? or use some translators like google translate or options like WPML for wordpress? interested in knowing the everyone is doing!
I use in angular a dependency called angular-translate. With this dependency you can decide how you want to store the translations. I personally save them in the database and load them at startup.
I'm coding on Linux since 1998 (before that I coded in DOS/Windows, with no other languages in mind). The best option for i18n at the time (that is still available and widely used), is GNU gettext. It can extract translatable strings from the source files, then you can translate them with various tools (including a plain text editor). For desktop applications there is still no better way I'm aware of. I also use it in my Flask apps (implemented via PyBabel).
All this is the easy part. What is much harder is l10n. Having your application translated to Hungarian, German, Indian and Chinese is one thing. But how will your users interpret this date? 10/11/12 Also, while Hungarian speakers will interpret 10,3 as 10.3, a lot of other languages will read “ten, comma, three” (two integers instead of one fractional).
Localisation is a really hard problem, and although there are some libraries to assist you, doing it right in every language is borderline impossible.
Shreyansh Pandey
node, coffee and everything in between
Till now, I have built just one multilingual site. The strategy I used was storing all the strings in a i18n database (JSON, or whatever), and then fetching the information based on the URL parameters; something like this
/en-US/home. This is really helpful when it comes to management. A simple interface helps in adding these string, and well, it works really fast.The JSON object looked something like this:
So, the
keyvalue here is the static string which helps us to identify the string. You use that key everywhere; the engine fetches the right translated version.I hope this helps! :)