Sha256: 1d6960fc3fd5f9235140451f6b6d9da319dcaa471cabf68a86c8c0c07c25b875

Contents?: true

Size: 628 Bytes

Versions: 25

Compression:

Stored size: 628 Bytes

Contents

module RailsI18n
  module Pluralization
    module Arabic
      def self.rule
        lambda do |n|
          mod100 = n % 100

          if n == 0
            :zero
          elsif n == 1
            :one
          elsif n == 2
            :two
          elsif (3..10).to_a.include?(mod100)
            :few
          elsif (11..99).to_a.include?(mod100)
            :many
          else
            :other
          end
        end
      end
    end
  end
end

{ :ar => {
    :'i18n' => {
      :plural => {
        :keys => [:zero, :one, :two, :few, :many, :other],
        :rule => RailsI18n::Pluralization::Arabic.rule }}}}

Version data entries

25 entries across 25 versions & 1 rubygems

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