Module: RailsI18n::Pluralization::OneWithZeroOther

Defined in:
lib/rails_i18n/common_pluralizations/one_with_zero_other.rb

Class Method Summary collapse

Class Method Details

.ruleObject



7
8
9
# File 'lib/rails_i18n/common_pluralizations/one_with_zero_other.rb', line 7

def self.rule
  lambda { |n| n == 0 || n == 1 ? :one : :other }
end

.with_locale(locale) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/rails_i18n/common_pluralizations/one_with_zero_other.rb', line 11

def self.with_locale(locale)
  { locale => {
      :'i18n' => {
        :plural => {
          :keys => [:one, :other],
          :rule => rule }}}}
end