Module: I18n::Backend::Sequel::Implementation

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

Instance Method Summary collapse

Instance Method Details

#available_localesObject



14
15
16
# File 'lib/i18n/backend/sequel.rb', line 14

def available_locales
  Translation.available_locales
end

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



18
19
20
21
22
23
24
# File 'lib/i18n/backend/sequel.rb', line 18

def store_translations(locale, data, options = {})
  escape = options.fetch(:escape, true)
  flatten_translations(locale, data, escape, false).each do |key, value|
    Translation.locale(locale).lookup(expand_keys(key)).delete_all
    Translation.create(:locale => locale.to_s, :key => key.to_s, :value => value)
  end
end