Sha256: ab0f512c88e5391e37ecd5ca51fa1de12f9c8624d362fb91839b47896e4dc3c7

Contents?: true

Size: 612 Bytes

Versions: 77

Compression:

Stored size: 612 Bytes

Contents

# frozen_string_literal: true

{
  ru: {
    i18n: {
      plural: {
        keys: %i[zero one few many],
        rule: lambda do |n|
          if n.zero?
            :zero
          elsif n % 10 == 1 && n % 100 != 11
            # 1, 21, 31, 41, 51, 61...
            :one
          elsif [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100)
            # 2-4, 22-24, 32-34...
            :few
          elsif n % 10.zero? || ![5, 6, 7, 8, 9].include?(n % 10) || ![11, 12, 13, 14].include?(n % 100)
            # 0, 5-20, 25-30, 35-40...
            :many
          end
        end
      }
    }
  }
}

Version data entries

77 entries across 77 versions & 2 rubygems

Version Path
tramway-0.1.2 config/initializers/plurals.rb
tramway-0.1.1.1 config/initializers/plurals.rb
tramway-0.1.1 config/initializers/plurals.rb
tramway-core-5.0 config/initializers/plurals.rb
tramway-core-4.1.3.3 config/initializers/plurals.rb
tramway-core-4.1.3.2 config/initializers/plurals.rb
tramway-core-4.1.3.1 config/initializers/plurals.rb
tramway-core-4.1.3 config/initializers/plurals.rb
tramway-core-4.1.2 config/initializers/plurals.rb
tramway-core-4.1.1 config/initializers/plurals.rb
tramway-core-4.1 config/initializers/plurals.rb
tramway-core-4.0.2.1 config/initializers/plurals.rb
tramway-core-4.0.2 config/initializers/plurals.rb
tramway-core-4.0.1.2 config/initializers/plurals.rb
tramway-core-4.0.1.1 config/initializers/plurals.rb
tramway-core-4.0.1 config/initializers/plurals.rb
tramway-core-4.0.0.1 config/initializers/plurals.rb
tramway-core-4.0 config/initializers/plurals.rb
tramway-core-3.0.1.1 config/initializers/plurals.rb
tramway-core-3.0.1 config/initializers/plurals.rb