diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bc0030e..3f2b96cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * Drop support for Ruby 2.5. \[[#180](https://github.com/kslazarev/numbers_and_words/pull/180)\] * Drop support for Ruby 2.6. \[[#190](https://github.com/kslazarev/numbers_and_words/pull/190)\] * Add support for Ruby 3.2. \[[#193](https://github.com/kslazarev/numbers_and_words/pull/193)\] + * Remove pluralization rules for French. \[[#195](https://github.com/kslazarev/numbers_and_words/pull/195)\] * Your contribution here. ### Bugs diff --git a/lib/numbers_and_words/i18n/pluralization.rb b/lib/numbers_and_words/i18n/pluralization.rb index 49984af7..0ce4612c 100644 --- a/lib/numbers_and_words/i18n/pluralization.rb +++ b/lib/numbers_and_words/i18n/pluralization.rb @@ -3,7 +3,6 @@ require 'numbers_and_words/i18n/plurals/cs' require 'numbers_and_words/i18n/plurals/ru' require 'numbers_and_words/i18n/plurals/ua' -require 'numbers_and_words/i18n/plurals/fr' require 'numbers_and_words/i18n/plurals/lv' require 'numbers_and_words/i18n/plurals/lt' diff --git a/lib/numbers_and_words/i18n/plurals/fr.rb b/lib/numbers_and_words/i18n/plurals/fr.rb deleted file mode 100644 index c1559970..00000000 --- a/lib/numbers_and_words/i18n/plurals/fr.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -module NumbersAndWords - module I18n - module Plurals - module Fr - module_function - - RULE = ->(number) { one_conditions(number) ? :one : :other } - - def one_conditions(number) - number % 10 == 1 && number % 100 != 11 - end - end - end - end -end diff --git a/numbers_and_words.gemspec b/numbers_and_words.gemspec index 36645341..2a65d50e 100644 --- a/numbers_and_words.gemspec +++ b/numbers_and_words.gemspec @@ -54,7 +54,6 @@ Gem::Specification.new do |s| "lib/numbers_and_words/i18n/locales/numbers.vi.yml", "lib/numbers_and_words/i18n/pluralization.rb", "lib/numbers_and_words/i18n/plurals/cs.rb", - "lib/numbers_and_words/i18n/plurals/fr.rb", "lib/numbers_and_words/i18n/plurals/lt.rb", "lib/numbers_and_words/i18n/plurals/lv.rb", "lib/numbers_and_words/i18n/plurals/plurals.rb", diff --git a/spec/numbers_and_words/i18n/pluralization/fr_spec.rb b/spec/numbers_and_words/i18n/pluralization/fr_spec.rb deleted file mode 100644 index f4fb13c0..00000000 --- a/spec/numbers_and_words/i18n/pluralization/fr_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -describe I18n, '#fr' do - it 'pluralizes correctly' do - hash = {} - %w[one other].each { |key| hash[key.to_sym] = key } - - expect(described_class.backend.send(:pluralize, :fr, hash, 1)).to eq('one') - expect(described_class.backend.send(:pluralize, :fr, hash, 2)).to eq('other') - expect(described_class.backend.send(:pluralize, :fr, hash, 3)).to eq('other') - expect(described_class.backend.send(:pluralize, :fr, hash, 5)).to eq('other') - expect(described_class.backend.send(:pluralize, :fr, hash, 10)).to eq('other') - expect(described_class.backend.send(:pluralize, :fr, hash, 11)).to eq('other') - expect(described_class.backend.send(:pluralize, :fr, hash, 21)).to eq('one') - expect(described_class.backend.send(:pluralize, :fr, hash, 29)).to eq('other') - expect(described_class.backend.send(:pluralize, :fr, hash, 131)).to eq('one') - expect(described_class.backend.send(:pluralize, :fr, hash, 1.31)).to eq('other') - expect(described_class.backend.send(:pluralize, :fr, hash, 2.31)).to eq('other') - expect(described_class.backend.send(:pluralize, :fr, hash, 3.31)).to eq('other') - end -end diff --git a/spec/numbers_and_words/integer/fixture_examples/fr.yml b/spec/numbers_and_words/integer/fixture_examples/fr.yml index 84ea1167..35e60880 100644 --- a/spec/numbers_and_words/integer/fixture_examples/fr.yml +++ b/spec/numbers_and_words/integer/fixture_examples/fr.yml @@ -37,6 +37,7 @@ to_words: 2000000: deux millions 4000000: quatre millions 5000000: cinq millions + 21000000: vingt et un millions 999000000: neuf cent quatre-vingt-dix-neuf millions 999000999: neuf cent quatre-vingt-dix-neuf millions neuf cent quatre-vingt-dix-neuf 999999000: neuf cent quatre-vingt-dix-neuf millions neuf cent quatre-vingt-dix-neuf mille @@ -44,6 +45,7 @@ to_words: billions: 1174315110: un milliard cent soixante-quatorze millions trois cent quinze mille cent dix 1174315119: un milliard cent soixante-quatorze millions trois cent quinze mille cent dix-neuf + 31151315119: trente et un milliards cent cinquante et un millions trois cent quinze mille cent dix-neuf 15174315119: quinze milliards cent soixante-quatorze millions trois cent quinze mille cent dix-neuf 35174315119: trente-cinq milliards cent soixante-quatorze millions trois cent quinze mille cent dix-neuf 935174315119: neuf cent trente-cinq milliards cent soixante-quatorze millions trois cent quinze mille cent dix-neuf