aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
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 /activesupport
parentc9ed2c9bd24b9f4cdfcb692151f87ba900469e71 (diff)
downloadrails-84816ae981a8598e5e401eb1b9b805de840fefc9.tar.gz
rails-84816ae981a8598e5e401eb1b9b805de840fefc9.tar.bz2
rails-84816ae981a8598e5e401eb1b9b805de840fefc9.zip
align with changes in i18n
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/array/conversions.rb5
m---------activesupport/lib/active_support/vendor/i18n-0.0.10
-rw-r--r--activesupport/test/i18n_test.rb12
3 files changed, 7 insertions, 10 deletions
diff --git a/activesupport/lib/active_support/core_ext/array/conversions.rb b/activesupport/lib/active_support/core_ext/array/conversions.rb
index 80bf1404de..59dc96754f 100644
--- a/activesupport/lib/active_support/core_ext/array/conversions.rb
+++ b/activesupport/lib/active_support/core_ext/array/conversions.rb
@@ -10,10 +10,7 @@ module ActiveSupport #:nodoc:
def to_sentence(options = {})
options.assert_valid_keys(:connector, :skip_last_comma, :locale)
- locale = options[:locale]
- locale ||= self.locale if respond_to?(:locale)
-
- default = I18n.translate(:'support.array.sentence_connector', locale)
+ default = I18n.translate(:'support.array.sentence_connector', :locale => options[:locale])
options.reverse_merge! :connector => default, :skip_last_comma => false
options[:connector] = "#{options[:connector]} " unless options[:connector].nil? || options[:connector].strip == ''
diff --git a/activesupport/lib/active_support/vendor/i18n-0.0.1 b/activesupport/lib/active_support/vendor/i18n-0.0.1
-Subproject 970bc7ab5faa94e41ee4a56bc8913c144c1cdd1
+Subproject 46aad289935eaf059c429acb5f3bfa0946f2d99
diff --git a/activesupport/test/i18n_test.rb b/activesupport/test/i18n_test.rb
index e6d90f09c1..17074b6cc6 100644
--- a/activesupport/test/i18n_test.rb
+++ b/activesupport/test/i18n_test.rb
@@ -18,15 +18,15 @@ class I18nTest < Test::Unit::TestCase
end
def test_date_localization_with_default_format
- assert_equal "2008-07-02", I18n.localize(@date, nil, :default)
+ assert_equal "2008-07-02", I18n.localize(@date, :format => :default)
end
def test_date_localization_with_short_format
- assert_equal "Jul 02", I18n.localize(@date, nil, :short)
+ assert_equal "Jul 02", I18n.localize(@date, :format => :short)
end
def test_date_localization_with_long_format
- assert_equal "July 02, 2008", I18n.localize(@date, nil, :long)
+ assert_equal "July 02, 2008", I18n.localize(@date, :format => :long)
end
def test_time_localization_should_use_default_format
@@ -34,15 +34,15 @@ class I18nTest < Test::Unit::TestCase
end
def test_time_localization_with_default_format
- assert_equal "Wed, 02 Jul 2008 16:47:01 +0100", I18n.localize(@time, nil, :default)
+ assert_equal "Wed, 02 Jul 2008 16:47:01 +0100", I18n.localize(@time, :format => :default)
end
def test_time_localization_with_short_format
- assert_equal "02 Jul 16:47", I18n.localize(@time, nil, :short)
+ assert_equal "02 Jul 16:47", I18n.localize(@time, :format => :short)
end
def test_time_localization_with_long_format
- assert_equal "July 02, 2008 16:47", I18n.localize(@time, nil, :long)
+ assert_equal "July 02, 2008 16:47", I18n.localize(@time, :format => :long)
end
def test_day_names