instance method
pluralize
Ruby on Rails 2.3.18
Since v2.3.18 Last seen in v2.3.18Signature
pluralize(locale, entry, count)
Picks a translation from an array according to English pluralization rules. It will pick the first translation if count is not equal to 1 and the second translation if it is equal to 1. Other backends can implement more flexible or complex pluralization rules.
Parameters
-
localereq -
entryreq -
countreq
Source
# File activesupport/lib/active_support/vendor/i18n-0.4.1/i18n/backend/base.rb, line 135
def pluralize(locale, entry, count)
return entry unless entry.is_a?(Hash) && count
key = :zero if count == 0 && entry.has_key?(:zero)
key ||= count == 1 ? :one : :other
raise InvalidPluralizationData.new(entry, count) unless entry.has_key?(key)
entry[key]
end
Defined in activesupport/lib/active_support/vendor/i18n-0.4.1/i18n/backend/base.rb line 135
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in I18n::Backend::Base