Skip to content

Instantly share code, notes, and snippets.

@geetfun
Forked from madrobby/i18n.coffee
Created November 14, 2011 16:04
Show Gist options
  • Save geetfun/1364287 to your computer and use it in GitHub Desktop.
Save geetfun/1364287 to your computer and use it in GitHub Desktop.

Revisions

  1. @madrobby madrobby created this gist Nov 14, 2011.
    5 changes: 5 additions & 0 deletions i18n.coffee
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    window.t = (id, vars = {}) ->
    template = i18n[__locale][id] or i18n['en'][id] or "(?) #{id}"
    _.template(template, vars)

    # yes, that's it