Module: RailsI18n::Pluralization::Romanian

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

Class Method Summary collapse

Class Method Details

.ruleObject



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

def self.rule
  lambda do |n|
    if n == 1
      :one
    elsif n == 0 || (1..19).to_a.include?(n % 100)
      :few
    else
      :other
    end
  end
end

.with_locale(locale) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/rails_i18n/common_pluralizations/romanian.rb', line 18

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