Module: I18n::Backend::Tr8n::Implementation

Includes:
Base, Flatten
Included in:
I18n::Backend::Tr8n
Defined in:
lib/i18n/backend/tr8n.rb

Instance Method Summary collapse

Instance Method Details

#applicationObject



42
43
44
# File 'lib/i18n/backend/tr8n.rb', line 42

def application
  ::Tr8n.session.application
end

#available_localesObject



46
47
48
# File 'lib/i18n/backend/tr8n.rb', line 46

def available_locales
  application.locales
end

#lookup(locale, key, scope = [], options = {}) ⇒ Object



50
51
52
53
54
# File 'lib/i18n/backend/tr8n.rb', line 50

def lookup(locale, key, scope = [], options = {})
  default_key = super(application.default_locale, key, scope, options)
  default_key ||= key
  application.language(locale.to_s).translate(default_key)
end