Module: RailsI18n::Pluralization::Slovenian

Defined in:
lib/rails_i18n/pluralization.rb

Class Method Summary collapse

Class Method Details

.ruleObject



129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/rails_i18n/pluralization.rb', line 129

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

    case n % 100
    when 1 then :one
    when 2 then :two
    when 3, 4 then :few
    else :other
    end
  end
end