module Noticed::Translation
Public Instance Methods
i18n_scope()
click to toggle source
Returns the i18n_scope
for the class. Overwrite if you want custom lookup.
# File lib/noticed/translation.rb, line 6 def i18n_scope :notifications end
scope_translation_key(key)
click to toggle source
# File lib/noticed/translation.rb, line 15 def scope_translation_key(key) if key.to_s.start_with?(".") "#{i18n_scope}.#{self.class.name.underscore}#{key}" else key end end
translate(key, **options)
click to toggle source
# File lib/noticed/translation.rb, line 10 def translate(key, **options) I18n.translate(scope_translation_key(key), **options) end
Also aliased as: t