Module: I18n::Backend::RemoteBackend::Implementation

Includes:
Base
Included in:
I18n::Backend::RemoteBackend
Defined in:
lib/i18n/backend/remote_backend/implementation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#storeObject

Returns the value of attribute store.



11
12
13
# File 'lib/i18n/backend/remote_backend/implementation.rb', line 11

def store
  @store
end

Instance Method Details

#available_localesObject



26
27
28
# File 'lib/i18n/backend/remote_backend/implementation.rb', line 26

def available_locales
  @store.keys.map(&:to_sym)
end

#init_translationsObject



34
35
36
# File 'lib/i18n/backend/remote_backend/implementation.rb', line 34

def init_translations
  @store
end

#initializeObject



13
14
15
16
# File 'lib/i18n/backend/remote_backend/implementation.rb', line 13

def initialize
  @store = {}
  I18n.enforce_available_locales = false
end

#initialized?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/i18n/backend/remote_backend/implementation.rb', line 18

def initialized?
  !@store.nil?
end

#store_translations(locale, data, _options = {}) ⇒ Object



22
23
24
# File 'lib/i18n/backend/remote_backend/implementation.rb', line 22

def store_translations(locale, data, _options = {})
  @store[locale] = data
end

#translationsObject



30
31
32
# File 'lib/i18n/backend/remote_backend/implementation.rb', line 30

def translations
  @store
end