diff options
author | Akira Matsuda <ronnie@dio.jp> | 2009-08-26 14:00:06 +0200 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-08-26 13:55:57 -0700 |
commit | cc9af20da7af98464ece18d4abc6a22ef3f00b5d (patch) | |
tree | acda0720f737ee2000a26b71dd0047fb1090a026 /actionpack/lib | |
parent | a7ca5595a21fa3bfd0ef51e6a56fbb80a13e040b (diff) | |
download | rails-cc9af20da7af98464ece18d4abc6a22ef3f00b5d.tar.gz rails-cc9af20da7af98464ece18d4abc6a22ef3f00b5d.tar.bz2 rails-cc9af20da7af98464ece18d4abc6a22ef3f00b5d.zip |
I18n: use I18n for select helpers' prompt text
[#2252 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/helpers/form_options_helper.rb | 3 | ||||
-rw-r--r-- | actionpack/lib/action_view/locale/en.yml | 4 |
2 files changed, 6 insertions, 1 deletions
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 = "<option value=\"\">#{options[:include_blank] if options[:include_blank].kind_of?(String)}</option>\n" + option_tags end if value.blank? && options[:prompt] - ("<option value=\"\">#{options[:prompt].kind_of?(String) ? options[:prompt] : 'Please select'}</option>\n") + option_tags + prompt = options[:prompt].kind_of?(String) ? options[:prompt] : I18n.translate('support.select.prompt', :default => 'Please select') + "<option value=\"\">#{prompt}</option>\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 |