module RailsI18n::Pluralization::ScottishGaelic

Public Class Methods

rule() click to toggle source
# File lib/rails_i18n/pluralization.rb, line 28
def self.rule
  lambda do |n|
    return :other unless n.is_a?(Numeric)

    floorn = n.floor

    if floorn == 1 || floorn == 11
      :one
    elsif floorn == 2 || floorn == 12
      :two
    elsif (3..19).member?(floorn)
      :few
    else
      :other
    end
  end
end