Files
ember-panda/app/helpers/dynamic-path-t.coffee
2017-12-21 11:51:55 +01:00

8 lines
351 B
CoffeeScript

import Ember from 'ember'
export default Ember.Helper.helper ([path_part, rest...], options)->
toptions = options
path = "#{path_part}.#{options.postpath}"
text = t(path, toptions)
tag = if options.bare then text else "<span data-t='#{path}' class='translation' data-t-attributes='#{JSON.stringify(toptions)}'>#{text}</span>"
tag.htmlSafe()