Sha256: 78277bee378ce889f3687822c38372696ec0f17a914ceb9a55a54f4af6a5e9aa

Contents?: true

Size: 648 Bytes

Versions: 27

Compression:

Stored size: 648 Bytes

Contents

module RailsI18n
  module Pluralization
    module Polish
      def self.rule
        lambda do |n|
          n ||= 0
          mod10 = n % 10
          mod100 = n % 100

          if n == 1
            :one
          elsif [2, 3, 4].include?(mod10) && ![12, 13, 14].include?(mod100)
            :few
          elsif ([0, 1] + (5..9).to_a).include?(mod10) || [12, 13, 14].include?(mod100)
            :many
          else
            :other
          end
        end
      end
    end
  end
end

{ :pl => {
    :'i18n' => {
      :plural => {
        :keys => [:one, :few, :many, :other],
        :rule => RailsI18n::Pluralization::Polish.rule }}}}

Version data entries

27 entries across 27 versions & 2 rubygems

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