From adedf72821a5623227ce91e6b298838e692477e4 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Wed, 26 Aug 2009 14:00:06 +0200 Subject: I18n: use I18n for select helpers' prompt text [#2252 state:committed] Signed-off-by: Jeremy Kemper --- actionpack/lib/action_view/helpers/form_options_helper.rb | 3 ++- actionpack/lib/action_view/locale/en.yml | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_view') diff --git a/actionpack/lib/action_view/helpers/form_options_helper.rb b/actionpack/lib/action_view/helpers/form_options_helper.rb index 4620a52272..3db5202e7d 100644 --- a/actionpack/lib/action_view/helpers/form_options_helper.rb +++ b/actionpack/lib/action_view/helpers/form_options_helper.rb @@ -571,7 +571,8 @@ module ActionView option_tags = "\n" + option_tags end if value.blank? && options[:prompt] - ("\n") + option_tags + prompt = options[:prompt].kind_of?(String) ? options[:prompt] : I18n.translate('support.select.prompt', :default => 'Please select') + "\n" + option_tags else option_tags end diff --git a/actionpack/lib/action_view/locale/en.yml b/actionpack/lib/action_view/locale/en.yml index afe35691bc..c82cd07ec2 100644 --- a/actionpack/lib/action_view/locale/en.yml +++ b/actionpack/lib/action_view/locale/en.yml @@ -108,3 +108,7 @@ # The variable :count is also available body: "There were problems with the following fields:" + support: + select: + # default value for :prompt => true in FormOptionsHelper + prompt: "Please select" \ No newline at end of file -- cgit v1.2.3