Module: Hanami::Helpers::I18nHelper
- Includes:
- Methods
- Included in:
- Extensions::View::StandardHelpers
- Defined in:
- lib/hanami/helpers/i18n_helper.rb
Overview
View-layer translation and localization helpers.
These helpers are automatically available in your view templates, part classes, and scope
classes when the i18n gem is bundled. They provide translate/t, translate!/t!, and
localize/l, sourcing the i18n backend from the view context and expanding relative
(leading-dot) translation keys against the currently-rendering template name.
The shared translate/localize logic lives in Methods, which is also included by the
action-layer i18n helper (Extensions::Action::I18nHelper). This module supplies
the two view-specific concrete implementations of Methods's abstract hooks: #_i18n
returns the i18n backend from the view context, and #_resolve_i18n_key expands relative
keys against the template name.
Defined Under Namespace
Modules: Methods
Constant Summary
Constants included from Methods
Methods::HTML_SAFE_TRANSLATION_KEY