From d69b4b7bea28fcab04f61afe381e06fa8e37b429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tarmo=20T=C3=A4nav?= Date: Tue, 7 Oct 2008 14:23:05 +0300 Subject: Made i18n simple backend able to store false values (and not confuse them with nil or lack of value) Implemented support.array.skip_last_comma i18n key for Array#to_sentence, this also tests the ability to store false. Signed-off-by: Pratik Naik --- activesupport/lib/active_support/core_ext/array/conversions.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/core_ext') diff --git a/activesupport/lib/active_support/core_ext/array/conversions.rb b/activesupport/lib/active_support/core_ext/array/conversions.rb index e67b719ddb..11c128da22 100644 --- a/activesupport/lib/active_support/core_ext/array/conversions.rb +++ b/activesupport/lib/active_support/core_ext/array/conversions.rb @@ -11,7 +11,8 @@ module ActiveSupport #:nodoc: options.assert_valid_keys(:connector, :skip_last_comma, :locale) default = I18n.translate(:'support.array.sentence_connector', :locale => options[:locale]) - options.reverse_merge! :connector => default, :skip_last_comma => false + default_skip_last_comma = I18n.translate(:'support.array.skip_last_comma', :locale => options[:locale]) + options.reverse_merge! :connector => default, :skip_last_comma => default_skip_last_comma options[:connector] = "#{options[:connector]} " unless options[:connector].nil? || options[:connector].strip == '' case length -- cgit v1.2.3