Skip to content

Commit

Permalink
Merge pull request #1812 from motine/pass-base-to-i18n
Browse files Browse the repository at this point in the history
Pass base object to `human_attribute_name` for labels
  • Loading branch information
nashby authored Jun 25, 2024
2 parents 33b1c54 + 1d9890e commit b8abb1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/simple_form/components/labels.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def label_translation #:nodoc:
if SimpleForm.translate_labels && (translated_label = translate_from_namespace(:labels))
translated_label
elsif object.class.respond_to?(:human_attribute_name)
object.class.human_attribute_name(reflection_or_attribute_name.to_s)
object.class.human_attribute_name(reflection_or_attribute_name.to_s, { base: object })
else
attribute_name.to_s.humanize
end
Expand Down

0 comments on commit b8abb1b

Please sign in to comment.