Skip to content

Commit

Permalink
Add reject to remove attributes from entry
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiosammy committed Mar 3, 2020
1 parent 4336047 commit 572bca8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/i18n/backend/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 572bca8

Please sign in to comment.