Module: Precious::Views::LocaleHelpers
- Included in:
- Layout
- Defined in:
- lib/gollum/views/helpers/locale_helpers.rb
Constant Summary collapse
- NO_METHOD_MESSAGE =
'Argument must be a view method'- YAML_VARIABLE_REGEXP =
/\%\{[\w]+\}/
Instance Method Summary collapse
-
#t ⇒ Object
Returns all I18n translation strings for the current view class.
-
#tt ⇒ Object
Returns all I18n translation strings from the root of an I18n YAML file.
Instance Method Details
#t ⇒ Object
Returns all I18n translation strings for the current view class. This method support YAML arguments. For example:
last_edited: This content was last edited at %{date}.
Where the date argument must be a method available on the current
class.
Use this interface within Mustache templates to render any user interface strings in the current locale. For example:
{{ t.last_edited }}
20 21 22 |
# File 'lib/gollum/views/helpers/locale_helpers.rb', line 20 def t autofill I18n.t(locale_klass_name) end |
#tt ⇒ Object
Returns all I18n translation strings from the root of an I18n YAML file.
Otherwise, it works exactly like the #t method that's also defined in
this file.
27 28 29 |
# File 'lib/gollum/views/helpers/locale_helpers.rb', line 27 def tt autofill I18n.t('.') end |