lib/alephant/views/base.rb in alephant-renderer-0.0.7 vs lib/alephant/views/base.rb in alephant-renderer-0.0.8

- old
+ new

@@ -6,17 +6,19 @@ module Alephant::Views class Base < Mustache attr_accessor :data - LOCALE = :en - def initialize(data = {}) @data = Hashie::Mash.new data end + def locale + :en + end + def t(key, params = {}) - I18n.locale = self.class::LOCALE + I18n.locale = locale prefix = /\/([^\/]+)\./.match(template_file)[1] I18n.translate("#{prefix}.#{key}", params) end def self.inherited(subclass)