8 lines
390 B
CoffeeScript
8 lines
390 B
CoffeeScript
Ember.Handlebars.helper 't', (path, params..., options)->
|
|
toptions = options.hash
|
|
if params.length and typeof(params[0].serialize) is 'function'
|
|
$.extend toptions, params[0].serialize()
|
|
text = t(path, toptions)
|
|
tag = if options.hash.bare then text else "<span data-t='#{path}' class='translation' data-t-attributes='#{JSON.stringify(toptions)}'>#{text}</span>"
|
|
tag.htmlSafe()
|