Module: RailsI18n::Pluralization::UpperSorbian

Defined in:
lib/rails_i18n/pluralization.rb

Class Method Summary collapse

Class Method Details

.ruleObject



48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/rails_i18n/pluralization.rb', line 48

def self.rule
  lambda do |n|
    return :other unless n.is_a?(Numeric)

    mod100 = n % 100

    case mod100
    when 1 then :one
    when 2 then :two
    when 3, 4 then :few
    else :other
    end
  end
end