method
scope_key_by_partial
rails latest stable - Class:
ActionView::Helpers::TranslationHelper
scope_key_by_partial(key)private
No documentation available.
# File actionview/lib/action_view/helpers/translation_helper.rb, line 128
def scope_key_by_partial(key)
if key&.start_with?(".")
if @virtual_path
@_scope_key_by_partial_cache ||= {}
@_scope_key_by_partial_cache[@virtual_path] ||= @virtual_path.gsub(%{/_?}, ".")
"#{@_scope_key_by_partial_cache[@virtual_path]}#{key}"
else
raise "Cannot use t(#{key.inspect}) shortcut because path is not available"
end
else
key
end
end