Project

General

Profile

Feature #26618 ยป labelled_form_bulder_i18n.patch

Dmitry Lisichkin, 2017-08-03 14:44

View differences:

lib/redmine/views/labelled_form_builder.rb (revision )
55 55
  def label_for_field(field, options = {})
56 56
    return ''.html_safe if options.delete(:no_label)
57 57
    text = options[:label].is_a?(Symbol) ? l(options[:label]) : options[:label]
58
    text ||= l(("field_" + field.to_s.gsub(/\_id$/, "")).to_sym)
58
    text ||= @object.class.human_attribute_name(field)
59 59
    text += @template.content_tag("span", " *", :class => "required") if options.delete(:required)
60 60
    @template.content_tag("label", text.html_safe,
61 61
                                   :class => (@object && @object.errors[field].present? ? "error" : nil),
    (1-1/1)