From 572bca8b5eb55178eed622ed6befb9512017bf4d Mon Sep 17 00:00:00 2001 From: Fabio L Janiszevski Date: Tue, 3 Mar 2020 13:22:35 -0300 Subject: [PATCH] Add reject to remove attributes from entry --- lib/i18n/backend/base.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/i18n/backend/base.rb b/lib/i18n/backend/base.rb index 285e5e61..698f2d5b 100644 --- a/lib/i18n/backend/base.rb +++ b/lib/i18n/backend/base.rb @@ -163,6 +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) + entry = entry.reject { |k, _v| k == :attributes } if entry.is_a?(Hash) return entry unless entry.is_a?(Hash) && count && entry.values.none? { |v| v.is_a?(Hash) } key = pluralization_key(entry, count)