diff --git a/index.js b/index.js index 600d68a..9b7ff5d 100644 --- a/index.js +++ b/index.js @@ -58,7 +58,7 @@ var defaultPluralRules = { bosnian_serbian: russianPluralGroups, chinese: function () { return 0; }, croatian: russianPluralGroups, - french: function (n) { return n > 1 ? 1 : 0; }, + french: function (n) { return n >= 2 ? 1 : 0; }, german: function (n) { return n !== 1 ? 1 : 0; }, russian: russianPluralGroups, lithuanian: function (n) { diff --git a/test/index.js b/test/index.js index 05206b5..9794093 100644 --- a/test/index.js +++ b/test/index.js @@ -702,6 +702,8 @@ describe('transformPhrase', function () { // French rule: "0" is singular expect(Polyglot.transformPhrase(english, { smart_count: 0 }, 'fr')).to.equal('0 Name'); expect(Polyglot.transformPhrase(english, { smart_count: 1 }, 'fr')).to.equal('1 Name'); + expect(Polyglot.transformPhrase(english, { smart_count: 1.5 }, 'fr')).to.equal('1.5 Name'); + // French rule: plural starts at 2 included expect(Polyglot.transformPhrase(english, { smart_count: 2 }, 'fr')).to.equal('2 Names'); expect(Polyglot.transformPhrase(english, { smart_count: 3 }, 'fr')).to.equal('3 Names');