Class: Riddick::Backends::Simple

Inherits:
Object
  • Object
show all
Defined in:
lib/riddick/backends/simple.rb

Overview

Wrapper aroud I18n::Backend::Simple.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(i18n_backend) ⇒ Simple

Returns a new instance of Simple.



7
8
9
# File 'lib/riddick/backends/simple.rb', line 7

def initialize(i18n_backend)
  @i18n_backend = i18n_backend
end

Instance Attribute Details

#i18n_backendObject (readonly)

Returns the value of attribute i18n_backend.



5
6
7
# File 'lib/riddick/backends/simple.rb', line 5

def i18n_backend
  @i18n_backend
end

Instance Method Details

#init_translationsObject

Ensure the translations are loaded.



18
19
20
# File 'lib/riddick/backends/simple.rb', line 18

def init_translations
  @i18n_backend.send :init_translations
end

#translationsObject

Calculate and return the default translations as a hash of type: => ‘baz!’



13
14
15
# File 'lib/riddick/backends/simple.rb', line 13

def translations
  @i18n_backend.send(:translations)[I18n.locale].riddick_normalize_i18n I18n.locale
end