From d6989aa0e1fe5e49fe1fccc3702aa7ff62a63faf Mon Sep 17 00:00:00 2001 From: Sven Fuchs Date: Sat, 23 Aug 2008 19:43:57 +0200 Subject: I18n: use :other instead of :many as default key for pluralization to better conform w/ cldr pluralization rules Signed-off-by: Michael Koziarski --- .../lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb') diff --git a/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb b/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb index 63ef55631f..6c7c54777c 100644 --- a/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb +++ b/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb @@ -104,7 +104,7 @@ module I18n return entry unless entry.is_a?(Hash) and count # raise InvalidPluralizationData.new(entry, count) unless entry.is_a?(Hash) key = :zero if count == 0 && entry.has_key?(:zero) - key ||= count == 1 ? :one : :many + key ||= count == 1 ? :one : :other raise InvalidPluralizationData.new(entry, count) unless entry.has_key?(key) entry[key] end -- cgit v1.2.3 From 92a7239a3dd1de672730f7b0bcf5f5d2cb0f877f Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sat, 23 Aug 2008 16:03:00 -0700 Subject: Ruby 1.9: silence some warnings for block args shadowing local vars --- .../active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb') diff --git a/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb b/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb index 6c7c54777c..43ff686514 100644 --- a/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb +++ b/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb @@ -27,7 +27,7 @@ module I18n def translate(locale, key, options = {}) raise InvalidLocale.new(locale) if locale.nil? - return key.map{|key| translate locale, key, options } if key.is_a? Array + return key.map{|k| translate locale, k, options } if key.is_a? Array reserved = :scope, :default count, scope, default = options.values_at(:count, *reserved) @@ -74,7 +74,7 @@ module I18n def lookup(locale, key, scope = []) return unless key keys = I18n.send :normalize_translation_keys, locale, key, scope - keys.inject(translations){|result, key| result[key.to_sym] or return nil } + keys.inject(translations){|result, k| result[k.to_sym] or return nil } end # Evaluates a default translation. @@ -147,9 +147,9 @@ module I18n type = File.extname(filename).tr('.', '').downcase raise UnknownFileType.new(type, filename) unless respond_to? :"load_#{type}" data = send :"load_#{type}", filename # TODO raise a meaningful exception if this does not yield a Hash - data.each do |locale, data| - merge_translations locale, data - end + data.each do |locale, d| + merge_translations locale, d + end end # Loads a plain Ruby translations file. eval'ing the file must yield -- cgit v1.2.3