module RailsI18n::Pluralization::OneTwoOther

Public Class Methods

rule() click to toggle source
# File lib/rails_i18n/common_pluralizations/one_two_other.rb, line 7
def self.rule
  lambda do |n|
    case n
    when 1 then :one
    when 2 then :two
    else :other
    end
  end
end
with_locale(locale) click to toggle source
# File lib/rails_i18n/common_pluralizations/one_two_other.rb, line 17
def self.with_locale(locale)
  { locale => {
      :'i18n' => {
        :plural => {
          :keys => [:one, :two, :other],
          :rule => rule }}}}
end