Skip to content

Instantly share code, notes, and snippets.

@srdjan
Forked from madrobby/i18n.coffee
Created November 14, 2011 20:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save srdjan/1364986 to your computer and use it in GitHub Desktop.
Save srdjan/1364986 to your computer and use it in GitHub Desktop.
Backbone i18n with CoffeeScript
window.t = (id, vars = {}) ->
template = i18n[__locale][id] or i18n['en'][id] or "(?) #{id}"
_.template(template, vars)
# yes, that's it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment