Orbit/app/models/i18n_liquid.rb

14 lines
322 B
Ruby
Raw Normal View History

class I18nLiquid < Liquid::Tag
def initialize(tag_name, value, tokens)
super
@value = value.to_s
end
def render(context)
I18nVariable.first(:conditions => {:key => @value})[I18n.locale] rescue ''
end
end
Liquid::Template.register_tag('t', I18nLiquid)