instance method
locale=
Ruby on Rails 3.1.12
Since v3.0.20 Last seen in v3.1.12Available in: v3.0.20 v3.1.12
Signature
locale=(value)
Overload locale= to also set the I18n.locale. If the current I18n.config object responds to original_config, it means that it’s has a copy of the original I18n configuration and it’s acting as proxy, which we need to skip.
Parameters
-
valuereq
Source
# File actionpack/lib/action_view/lookup_context.rb, line 194
def locale=(value)
if value
config = I18n.config.respond_to?(:original_config) ? I18n.config.original_config : I18n.config
config.locale = value
end
super(@skip_default_locale ? I18n.locale : _locale_defaults)
end
Defined in actionpack/lib/action_view/lookup_context.rb line 194
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionView::LookupContext::Details