aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorSven Fuchs <svenfuchs@artweb-design.de>2008-07-06 21:20:02 +0200
committerSven Fuchs <svenfuchs@artweb-design.de>2008-07-06 21:20:02 +0200
commit84816ae981a8598e5e401eb1b9b805de840fefc9 (patch)
tree8b995401f92c8dcd8c53e3f332687219480e4def /actionpack/lib
parentc9ed2c9bd24b9f4cdfcb692151f87ba900469e71 (diff)
downloadrails-84816ae981a8598e5e401eb1b9b805de840fefc9.tar.gz
rails-84816ae981a8598e5e401eb1b9b805de840fefc9.tar.bz2
rails-84816ae981a8598e5e401eb1b9b805de840fefc9.zip
align with changes in i18n
Diffstat (limited to 'actionpack/lib')
-rwxr-xr-xactionpack/lib/action_view/helpers/date_helper.rb5
-rw-r--r--actionpack/lib/action_view/helpers/number_helper.rb2
-rw-r--r--actionpack/lib/action_view/helpers/translation_helper.rb6
3 files changed, 6 insertions, 7 deletions
diff --git a/actionpack/lib/action_view/helpers/date_helper.rb b/actionpack/lib/action_view/helpers/date_helper.rb
index d306c7a742..61fff42d5a 100755
--- a/actionpack/lib/action_view/helpers/date_helper.rb
+++ b/actionpack/lib/action_view/helpers/date_helper.rb
@@ -504,7 +504,6 @@ module ActionView
#
def select_month(date, options = {}, html_options = {})
locale = options[:locale]
- locale ||= self.locale if respond_to?(:locale)
val = date ? (date.kind_of?(Fixnum) ? date : date.month) : ''
if options[:use_hidden]
@@ -513,7 +512,7 @@ module ActionView
month_options = []
month_names = options[:use_month_names] || begin
key = options[:use_short_month] ? :'date.abbr_month_names' : :'date.month_names'
- I18n.translate key, locale
+ I18n.translate key, :locale => locale
end
month_names.unshift(nil) if month_names.size < 13
@@ -633,7 +632,7 @@ module ActionView
position = { :year => 1, :month => 2, :day => 3, :hour => 4, :minute => 5, :second => 6 }
- order = options[:order] ||= I18n.translate(:'date.order', locale)
+ order = options[:order] ||= I18n.translate(:'date.order', :locale => locale)
# Discard explicit and implicit by not being included in the :order
discard = {}
diff --git a/actionpack/lib/action_view/helpers/number_helper.rb b/actionpack/lib/action_view/helpers/number_helper.rb
index 981589437d..6bb8263794 100644
--- a/actionpack/lib/action_view/helpers/number_helper.rb
+++ b/actionpack/lib/action_view/helpers/number_helper.rb
@@ -70,7 +70,7 @@ module ActionView
# # => 1234567890,50 &pound;
def number_to_currency(number, options = {})
options = options.symbolize_keys
- defaults = I18n.translate(:'currency.format', options[:locale]) || {}
+ defaults = I18n.translate(:'currency.format', :locale => options[:locale]) || {}
precision = options[:precision] || defaults[:precision]
unit = options[:unit] || defaults[:unit]
diff --git a/actionpack/lib/action_view/helpers/translation_helper.rb b/actionpack/lib/action_view/helpers/translation_helper.rb
index 0bfe6bf771..c13c2dfc04 100644
--- a/actionpack/lib/action_view/helpers/translation_helper.rb
+++ b/actionpack/lib/action_view/helpers/translation_helper.rb
@@ -4,11 +4,11 @@ module ActionView
module Helpers
module TranslationHelper
def translate(*args)
- key, locale, options = I18n.send :process_translate_arguments, *args
- I18n.translate key, locale, options.merge(:raise => true)
+ args << args.extract_options!.merge(:raise => true)
+ I18n.translate *args
rescue I18n::MissingTranslationData => e
- keys = I18n.send :normalize_translation_keys, locale, key, options[:scope]
+ keys = I18n.send :normalize_translation_keys, e.locale, e.key, e.options[:scope]
content_tag('span', keys.join(', '), :class => 'translation_missing')
end
end