Class: RailsI18nManager::TranslationApp

Inherits:
ApplicationRecord show all
Defined in:
app/models/rails_i18n_manager/translation_app.rb

Constant Summary collapse

NAME =
"Translated App".freeze

Instance Method Summary collapse

Instance Method Details

#additional_locales=(val) ⇒ Object



31
32
33
34
35
36
37
38
39
40
# File 'app/models/rails_i18n_manager/translation_app.rb', line 31

def additional_locales=(val)
  if val.is_a?(Array)
    val = val.map{|x| x.to_s.downcase.strip.presence }.compact.uniq.sort
    val.delete(self.default_locale)

    self[:additional_locales] = val.join(",")
  else
    self[:additional_locales] = val
  end
end

#additional_locales_arrayObject



42
43
44
# File 'app/models/rails_i18n_manager/translation_app.rb', line 42

def additional_locales_array
  additional_locales.to_s.split(",")
end

#all_localesObject



46
47
48
# File 'app/models/rails_i18n_manager/translation_app.rb', line 46

def all_locales
  [self.default_locale] + additional_locales_array
end