I want to localize templates in my Phonegap/Backbone mobile App. I want to somehow override underscore render function in a way that would always append extra attribute with languages. Let me show that on example:
lets say I required (require.js) the HomeView template wich looks like:
<div>
<p><%= language.get('someText') %></p>
</div>
In my HomeView.js I have:
var template = _.template(HomeTemplate);
this.$el.html( template({language: LanguageModel}));
This works, but I don't want to always append this language attribute to underscore template. Could I somehow overwrite that render function so It would always include language Model?