|
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)
|