aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionview/lib/action_view/helpers/tags/label.rb2
-rw-r--r--actionview/lib/action_view/helpers/tags/placeholderable.rb2
-rw-r--r--actionview/lib/action_view/helpers/tags/translator.rb2
3 files changed, 3 insertions, 3 deletions
diff --git a/actionview/lib/action_view/helpers/tags/label.rb b/actionview/lib/action_view/helpers/tags/label.rb
index 4159cb105f..b31d5fda66 100644
--- a/actionview/lib/action_view/helpers/tags/label.rb
+++ b/actionview/lib/action_view/helpers/tags/label.rb
@@ -18,7 +18,7 @@ module ActionView
content ||= Translator
.new(object, @object_name, method_and_value, scope: "helpers.label")
- .call
+ .translate
content ||= @method_name.humanize
content
diff --git a/actionview/lib/action_view/helpers/tags/placeholderable.rb b/actionview/lib/action_view/helpers/tags/placeholderable.rb
index db16ea7b0b..cf7b117614 100644
--- a/actionview/lib/action_view/helpers/tags/placeholderable.rb
+++ b/actionview/lib/action_view/helpers/tags/placeholderable.rb
@@ -11,7 +11,7 @@ module ActionView
placeholder ||= Tags::Translator
.new(object, @object_name, method_and_value, scope: "helpers.placeholder")
- .call
+ .translate
placeholder ||= @method_name.humanize
@options[:placeholder] = placeholder
end
diff --git a/actionview/lib/action_view/helpers/tags/translator.rb b/actionview/lib/action_view/helpers/tags/translator.rb
index 86d7d21308..829679851c 100644
--- a/actionview/lib/action_view/helpers/tags/translator.rb
+++ b/actionview/lib/action_view/helpers/tags/translator.rb
@@ -9,7 +9,7 @@ module ActionView
@model = object.respond_to?(:to_model) ? object.to_model : object
end
- def call
+ def translate
translated_attribute = I18n.t("#{object_name}.#{method_and_value}", default: i18n_default, scope: scope).presence
translated_attribute || human_attribute_name
end