Class: Authentication::Logic::I18n::Translator

Inherits:
Object
  • Object
show all
Defined in:
lib/auth/logic/i18n/translator.rb

Overview

The default translator used by auth/logic/i18n.rb

Instance Method Summary collapse

Instance Method Details

#translate(key, options = {}) ⇒ Object

If the I18n gem is present, calls I18n.translate passing all arguments, else returns options[:default].



10
11
12
13
14
15
16
# File 'lib/auth/logic/i18n/translator.rb', line 10

def translate(key, options = {})
  if defined?(::I18n)
    ::I18n.translate key, **options
  else
    options[:default]
  end
end