I’m using requireJS along with Jquery Mobile and have started to look at options of internationalizing an application.
Right now available languages (EN/DE/FR) are serverd from the database. When the user picks a new language I’m doing a changepage on the current page setting jqm option allowSamePageTransition=true, which re-fetches the page and adds it to the DOM (it’s in the DOM twice, but that’s ok for now.
Since the app eventually should work offline, I want to remove the languages from the database and store/server via JSON/Javascript, so switching languages would trigger the same event, only this time the translations will be served as JSON and I’m building stuff on the client.
I have been trying do this with the i18n plugin provided by requireJS and while this was super easy to setup, when the user switches languages manually I’m stuck with having to re-load the full application to display the new language, which is a no-go.
Question:
I have read a few questions on internationalization and suggested frameworks, but am unsure which way to go and haven’t really found any alternative.
Considering these:
– should be small and fast
– needs to work with JQM
– should use JSON/.po files I can build server side for download and keeping in cache/localstorage
– plural rules etc are ok, but not a must
what do you recommend using? What have been your experiences?
Thanks for sharing!
You might hava a look at http://i18next.com:
We personally use it a lot in combination with backbone.js and handlebars template engine. But will work with different setups as well.
I started the work on i18next because i wasn’t happy with the current situation. Most libraries where to complicated or had just not enough to offer proper localization – so i started i18next – which now is rather popular.