Sha256: 02592258582530c014d0b217e548cc577dfa4de22cb45a1491e1765ef234fad7

Contents?: true

Size: 536 Bytes

Versions: 25

Compression:

Stored size: 536 Bytes

Contents

# Used for Moldavian, Romanian.

module RailsI18n
  module Pluralization
    module Romanian
      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

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

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
rails-i18n-4.0.3 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-3.0.1 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-4.0.2 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-4.0.1 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-3.0.0 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-4.0.0 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-3.0.0.pre2 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-4.0.0.pre2 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-4.0.0.pre lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-3.0.0.pre lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-0.7.4 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-0.7.3 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-0.7.2 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-0.7.1 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-0.7.0 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-0.6.6 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-0.6.5 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-0.6.4 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-0.6.3 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-0.6.2 lib/rails_i18n/common_pluralizations/romanian.rb