Module: Loaf::Translation
- Defined in:
- lib/loaf/translation.rb
Class Method Summary collapse
-
.find_title(title, options = {}) ⇒ String
Translate breadcrumb title.
-
.translation_scope ⇒ String
private
Returns translation lookup.
Class Method Details
.find_title(title, options = {}) ⇒ String
Translate breadcrumb title
27 28 29 30 31 32 33 34 |
# File 'lib/loaf/translation.rb', line 27 def find_title(title, = {}) return title if title.nil? || title.empty? [:scope] ||= translation_scope [:default] = Array([:default]) [:default] << title if [:default].empty? I18n.t(title.to_s, **) end |
.translation_scope ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns translation lookup
10 11 12 |
# File 'lib/loaf/translation.rb', line 10 def translation_scope 'loaf.breadcrumbs' end |