module Seiel::I18nGoodies

Extend Rails' i18n_scope method to return the long path for i18n scopes

Public Instance Methods

error_message(key, data = {}) click to toggle source
# File lib/seiel/i18n_goodies.rb, line 23
def error_message(key, data = {})
  i18n key.to_s, :errors, :messages, data, model: true
end
i18n(key, *args, **kws) click to toggle source
# File lib/seiel/i18n_goodies.rb, line 17
def i18n(key, *args, **kws)
  key = send(key) if key.is_a? Symbol

  self.class.i18n(key, *args, **kws)
end
i18n_scope(*args) click to toggle source
# File lib/seiel/i18n_goodies.rb, line 13
def i18n_scope(*args)
  self.class.i18n_scope(*args)
end