Class: I18nAdmin::HstoreBackend

Inherits:
I18n::Backend::KeyValue
  • Object
show all
Defined in:
lib/i18n_admin/hstore_backend.rb

Defined Under Namespace

Classes: Store

Instance Method Summary collapse

Constructor Details

#initializeHstoreBackend

Returns a new instance of HstoreBackend.



51
52
53
# File 'lib/i18n_admin/hstore_backend.rb', line 51

def initialize
  @store = HstoreBackend::Store.new
end

Instance Method Details

#available_localesObject



5
6
7
# File 'lib/i18n_admin/hstore_backend.rb', line 5

def available_locales
  @available_locales ||= I18nAdmin::TranslationsSet.pluck(:locale)
end

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



55
56
57
58
59
# File 'lib/i18n_admin/hstore_backend.rb', line 55

def store_translations(locale, data, options = {})
  data.each do |key, value|
    store.store_translations(locale, key, value)
  end
end