Sha256: 06252015d0ac9405bf821080f08be103f3da70469ef2f20cd1bafb476264bde4

Contents?: true

Size: 488 Bytes

Versions: 5

Compression:

Stored size: 488 Bytes

Contents

# -*- encoding: utf-8 -*- 
 
{
  :'pl' => {
    :pluralize => lambda { |n| 
      # taken from http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html
      # TODO: check if they're really wrong about 22..24
      #
      #   one -> n is 1;
      #   few -> n mod 10 in 2..4 and n mod 100 not in 12..14;
      #   other -> everything else
      #
      n == 1 ? :one : [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100) ? :few : :other 
    }
  }
}

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
polish-0.0.5 lib/polish/locale/pluralize.rb
polish-0.0.4 lib/polish/locale/pluralize.rb
polish-0.0.3 lib/polish/locale/pluralize.rb
polish-0.0.2 lib/polish/locale/pluralize.rb
polish-0.0.1 lib/polish/locale/pluralize.rb