alchimikweb/traducto

View on GitHub
lib/traducto/helpers.rb

Summary

Maintainability
A
0 mins
Test Coverage
#*************************************************************************************
# Methods that will be inserted in the ActionView.
#*************************************************************************************
module Traducto::Helpers
  def t(key, options={})
    @traducto ||= Traducto::Base.new(self)

    return @traducto.translate(key, options)
  end

  def use_translations_of(action)
    @traducto ||= Traducto::Base.new(self)

    @traducto.add_action action
  end

  ::ActionView::Base.send :include, self
end