Sha256: da7366083d9049a4a8ab7cb8fa0b11c9ed9acc024100ff87b2e5e65792284c38

Contents?: true

Size: 736 Bytes

Versions: 25

Compression:

Stored size: 736 Bytes

Contents

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

          if mod10 == 1 && ![11,71,91].include?(mod100)
            :one
          elsif mod10 == 2 && ![12,72,92].include?(mod100)
            :two
          elsif [3,4,9].include?(mod10) && !((10..19).to_a + (70..79).to_a + (90..99).to_a).include?(mod100)
            :few
          elsif n % 1000000 == 0 && n != 0
            :many
          else
            :other
          end
        end
      end
    end
  end
end

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

Version data entries

25 entries across 25 versions & 1 rubygems

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