Module: I18n::Backend::ActiveRecord::Implementation
- Includes:
- Base, Flatten
- Included in:
- I18n::Backend::ActiveRecord
- Defined in:
- lib/i18n/backend/active_record.rb
Instance Method Summary collapse
Instance Method Details
#available_locales ⇒ Object
13 14 15 16 17 |
# File 'lib/i18n/backend/active_record.rb', line 13 def available_locales Translation.available_locales rescue ::ActiveRecord::StatementInvalid [] end |
#store_translations(locale, data, options = {}) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/i18n/backend/active_record.rb', line 19 def store_translations(locale, data, = {}) escape = .fetch(:escape, true) flatten_translations(locale, data, escape, false).each do |key, value| Translation.locale(locale).lookup((key)).delete_all Translation.create(:locale => locale.to_s, :key => key.to_s, :value => value) end end |