diff --git a/lib/i18n/backend/base.rb b/lib/i18n/backend/base.rb index d149081d..285e5e61 100644 --- a/lib/i18n/backend/base.rb +++ b/lib/i18n/backend/base.rb @@ -143,7 +143,7 @@ def resolve(locale, object, subject, options = EMPTY_HASH) result = catch(:exception) do case subject when Symbol - I18n.translate(subject, **options.merge(:locale => locale, :throw => true).except(:count)) + I18n.translate(subject, **options.merge(:locale => locale, :throw => true)) when Proc date_or_time = options.delete(:object) || object resolve(locale, object, subject.call(date_or_time, options)) @@ -163,7 +163,7 @@ def resolve(locale, object, subject, options = EMPTY_HASH) # not standard with regards to the CLDR pluralization rules. # Other backends can implement more flexible or complex pluralization rules. def pluralize(locale, entry, count) - return entry unless entry.is_a?(Hash) && count + return entry unless entry.is_a?(Hash) && count && entry.values.none? { |v| v.is_a?(Hash) } key = pluralization_key(entry, count) raise InvalidPluralizationData.new(entry, count, key) unless entry.has_key?(key) diff --git a/lib/i18n/backend/pluralization.rb b/lib/i18n/backend/pluralization.rb index a0a2f565..3bc45b10 100644 --- a/lib/i18n/backend/pluralization.rb +++ b/lib/i18n/backend/pluralization.rb @@ -29,7 +29,7 @@ module Pluralization # either pick a special :zero translation even for languages where the # pluralizer does not return a :zero key. def pluralize(locale, entry, count) - return entry unless entry.is_a?(Hash) and count + return entry unless entry.is_a?(Hash) && count && entry.values.none? { |v| v.is_a?(Hash) } pluralizer = pluralizer(locale) if pluralizer.respond_to?(:call)