I'm using i18next and I think it's great. I'm using it in conjuction with Backbone and Underscore templates. Let me explain my situation. As soon as the application kicks in, I init i18n and then I start Backbone history, so I'm pretty sure that i18n is ready when the application is started.
var option = {
debug: true
};
i18n.init(option).done(function()
{
Backbone.history.start();
});
Everything works fine because when I need to render my view, I just call a method and inside that method i do:
$("body").i18n();
I see everthing perfectly localized!
The problem is with views that render themselves and after data has been fetched from the server need to re-render. In that case, on that controls, localized text disappears. If I block the 2nd rendering when data is ready, everything is perfectly localized. Otherwise (even if I remove the first rendering when data is not ready yet), data doesn't appear.
What am I doing wrong?
Thanks, Marco