Skip to content

Instantly share code, notes, and snippets.

@jakobdamjensen
Created December 26, 2014 19:08
Show Gist options
  • Save jakobdamjensen/d43a986c93fe8aa1b5f3 to your computer and use it in GitHub Desktop.
Save jakobdamjensen/d43a986c93fe8aa1b5f3 to your computer and use it in GitHub Desktop.
Global Marionette Templatehelpers
var Mn = require('backbone.marionette'),
Radio = require('backbone.radio'),
i18nChannel = Radio.channel('i18n'),
_ = require('underscore');
_.extend(Mn.View.prototype, {
templateHelpers: {
t: function(key){
return i18nChannel.request('translate', key);
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment