You might think that the following code will have access to I18n:
= label_tag(:person_name)
and find en.helpers.label.person_name or something like that. However, the rails code does not seem to use I18n:
159: def label_tag(name = nil, content_or_options = nil, options = nil, &block)
160: options = content_or_options if block_given? && content_or_options.is_a?(Hash)
161: options ||= {}
162: options.stringify_keys!
163: options["for"] = sanitize_to_id(name) unless name.blank? || options.has_key?("for")
164: content_tag :label, content_or_options || name.to_s.humanize, options, &block
165: end
therefore, it seems the only option is to explicitly call label_tag(:person_name, I18n.t(:person_name)). This seems unnecessary, so am I missing something here or should I work on the rails patch? Any input is appreciated.
source
share