Class: I18nAdminUtils::Backend::ActiveRecordManager

Inherits:
Object
  • Object
show all
Defined in:
lib/i18n_admin_utils/backend/active_record_manager.rb

Class Method Summary collapse

Class Method Details

.save_translation(locale, key, value) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/i18n_admin_utils/backend/active_record_manager.rb', line 4

def self.save_translation(locale, key, value)
  translation = I18nAdminUtils::Config.translation_model.where(:locale => locale, :key => key).first
  if translation.nil?
    translation = I18nAdminUtils::Config.translation_model.new
    translation.locale = locale
    translation.key = key
  end
  translation.value = value
  translation.save
end