Module: Lita::Handler::Common::ClassMethods

Defined in:
lib/lita/handler/common.rb

Overview

Common class-level methods for all handlers.

Since:

  • 4.0.0

Instance Method Summary collapse

Instance Method Details

#translate(key, hash = {}) ⇒ String Also known as: t

Returns the translation for a key, automatically namespaced to the handler.

Since:

  • 3.0.0


21
22
23
# File 'lib/lita/handler/common.rb', line 21

def translate(key, hash = {})
  I18n.translate("lita.handlers.#{namespace}.#{key}", hash)
end