Sha256: df4d94257ef6f0f57957fa126b81185d72fd2572ac3ada51d21446e8af385d9a

Contents?: true

Size: 554 Bytes

Versions: 27

Compression:

Stored size: 554 Bytes

Contents

# Used for Moldavian, Romanian.

module RailsI18n
  module Pluralization
    module Romanian
      def self.rule
        lambda do |n|
          n ||= 0
          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

27 entries across 27 versions & 2 rubygems

Version Path
rails-i18n-7.0.6 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-7.0.5 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-7.0.3 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-7.0.2 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-7.0.1 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-6.0.0 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-6.0.0.beta1 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-5.1.3 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-5.1.2 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-5.1.1 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-5.1.0 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-5.0.4 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-5.0.3 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-5.0.2 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-5.0.1 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-5.0.0 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-4.0.9 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-5.0.0.beta4 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-5.0.0.beta3 lib/rails_i18n/common_pluralizations/romanian.rb
rails-i18n-5.0.0.beta2 lib/rails_i18n/common_pluralizations/romanian.rb