Module: RailsI18n::Pluralization::WestSlavic

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

Class Method Summary collapse

Class Method Details

.ruleObject



6
7
8
9
10
11
12
13
14
# File 'lib/rails_i18n/common_pluralizations/west_slavic.rb', line 6

def self.rule
  lambda do |n|
    case n
    when 1 then :one
    when 2, 3, 4 then :few
    else :other
    end
  end
end

.with_locale(locale) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/rails_i18n/common_pluralizations/west_slavic.rb', line 16

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