From c68cc49dcde6c7df4c11a1113fcd0d47220cddd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Thu, 7 Jan 2010 02:19:55 +0100 Subject: Use helpers.label instead of views.labels. --- actionpack/lib/action_view/helpers/form_helper.rb | 2 +- actionpack/lib/action_view/helpers/form_options_helper.rb | 2 +- actionpack/lib/action_view/locale/en.yml | 2 +- actionpack/test/template/form_helper_test.rb | 4 ++-- actionpack/test/template/form_options_helper_i18n_test.rb | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index 81c9c88820..da33f24c54 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -777,7 +777,7 @@ module ActionView options["for"] ||= name_and_id["id"] content = if text.blank? - I18n.t("views.labels.#{object_name}.#{method_name}", :default => "").presence + I18n.t("helpers.label.#{object_name}.#{method_name}", :default => "").presence else text.to_s end diff --git a/actionpack/lib/action_view/helpers/form_options_helper.rb b/actionpack/lib/action_view/helpers/form_options_helper.rb index 935ab5f3e8..02ad637509 100644 --- a/actionpack/lib/action_view/helpers/form_options_helper.rb +++ b/actionpack/lib/action_view/helpers/form_options_helper.rb @@ -571,7 +571,7 @@ module ActionView option_tags = "\n" + option_tags end if value.blank? && options[:prompt] - prompt = options[:prompt].kind_of?(String) ? options[:prompt] : I18n.translate('support.select.prompt', :default => 'Please select') + prompt = options[:prompt].kind_of?(String) ? options[:prompt] : I18n.translate('helpers.select.prompt', :default => 'Please select') "\n" + option_tags else option_tags diff --git a/actionpack/lib/action_view/locale/en.yml b/actionpack/lib/action_view/locale/en.yml index b5db998049..9918034020 100644 --- a/actionpack/lib/action_view/locale/en.yml +++ b/actionpack/lib/action_view/locale/en.yml @@ -110,7 +110,7 @@ # The variable :count is also available body: "There were problems with the following fields:" - support: + helpers: select: # default value for :prompt => true in FormOptionsHelper prompt: "Please select" diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb index b1e9fe99a2..acadbd0cd0 100644 --- a/actionpack/test/template/form_helper_test.rb +++ b/actionpack/test/template/form_helper_test.rb @@ -16,8 +16,8 @@ class FormHelperTest < ActionView::TestCase } } }, - :views => { - :labels => { + :helpers => { + :label => { :post => { :body => "Write entire text here" } diff --git a/actionpack/test/template/form_options_helper_i18n_test.rb b/actionpack/test/template/form_options_helper_i18n_test.rb index 91e370efa7..4972ea6511 100644 --- a/actionpack/test/template/form_options_helper_i18n_test.rb +++ b/actionpack/test/template/form_options_helper_i18n_test.rb @@ -6,7 +6,7 @@ class FormOptionsHelperI18nTests < ActionView::TestCase def setup @prompt_message = 'Select!' I18n.backend.send(:init_translations) - I18n.backend.store_translations :en, :support => { :select => { :prompt => @prompt_message } } + I18n.backend.store_translations :en, :helpers => { :select => { :prompt => @prompt_message } } end def teardown @@ -14,7 +14,7 @@ class FormOptionsHelperI18nTests < ActionView::TestCase end def test_select_with_prompt_true_translates_prompt_message - I18n.expects(:translate).with('support.select.prompt', { :default => 'Please select' }) + I18n.expects(:translate).with('helpers.select.prompt', { :default => 'Please select' }) select('post', 'category', [], :prompt => true) end @@ -24,4 +24,4 @@ class FormOptionsHelperI18nTests < ActionView::TestCase select('post', 'category', [], :prompt => true) ) end -end \ No newline at end of file +end -- cgit v1.2.3