class I18nAdmin::HstoreBackend

Public Class Methods

new() click to toggle source
# File lib/i18n_admin/hstore_backend.rb, line 51
def initialize
  @store = HstoreBackend::Store.new
end

Public Instance Methods

available_locales() click to toggle source
# File lib/i18n_admin/hstore_backend.rb, line 5
def available_locales
  @available_locales ||= I18nAdmin::TranslationsSet.pluck(:locale)
end
store_translations(locale, data, options = {}) click to toggle source
# 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

Protected Instance Methods

lookup(locale, key, scope = [], options = {}) click to toggle source
# File lib/i18n_admin/hstore_backend.rb, line 63
def lookup(locale, key, scope = [], options = {})
  key = normalize_flat_keys(locale, key, scope, options[:separator])
  store["#{locale}.#{key}"]
end