i18next-conv
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -124,8 +124,19 @@ var Gettext = require("node-gettext") | ||
if (ext.numbers.length === 2) { | ||
if (suffix === '-1') { | ||
suffix = '1'; | ||
} else if (suffix === '1') { | ||
suffix = '2'; | ||
// germanic like en | ||
if (ext.numbers[0] === 2) { | ||
if (suffix === '-1') { // regular plural | ||
suffix = '1'; | ||
} else if (suffix === '1') { // singular | ||
suffix = '2'; | ||
} | ||
} | ||
// romanic like fr | ||
else if (ext.numbers[0] === 1) { | ||
if (suffix === '-1') { // regular plural | ||
suffix = '2'; | ||
} else if (suffix === '1') { // singular | ||
suffix = '1'; | ||
} | ||
} | ||
} | ||
} | ||
@@ -271,7 +282,20 @@ for (var i = 0, len = ext.numbers.length; i < len; i++) { | ||
if (ext.numbers.length === 2) { | ||
if (number === 2) { | ||
number = 1; // is basic plural | ||
} else if (number === 1) { | ||
number = -1; // is singular | ||
} | ||
if (ext.numbers.length === 2) { | ||
// germanic like en | ||
if (ext.numbers[0] === 2) { | ||
if (number === 2) { | ||
number = 1; // singular | ||
} else if (number === 1) { | ||
number = -1; // regular plural | ||
} | ||
} | ||
// romanic like fr | ||
else if (ext.numbers[0] === 1) { | ||
if (number === 2) { | ||
number = -1; // regular plural | ||
} else if (number === 1) { | ||
number = 1; // singular | ||
} | ||
} | ||
} | ||
return number > 0 ? '' : '_plural'; | ||
@@ -278,0 +302,0 @@ } else { |
@@ -1085,6 +1085,17 @@ // definition http://translate.sourceforge.net/wiki/l10n/pluralforms | ||
if (ext.numbers.length === 2) { | ||
if (number === 2) { | ||
number = 1; | ||
} else if (number === 1) { | ||
number = -1; | ||
// germanic like en | ||
if (ext.numbers[0] === 2) { | ||
if (number === 2) { | ||
number = 1; // singular | ||
} else if (number === 1) { | ||
number = -1; // regular plural | ||
} | ||
} | ||
// romanic like fr | ||
else if (ext.numbers[0] === 1) { | ||
if (number === 2) { | ||
number = -1; // regular plural | ||
} else if (number === 1) { | ||
number = 1; // singular | ||
} | ||
} | ||
@@ -1091,0 +1102,0 @@ } //console.log(count + '-' + number); |
@@ -6,3 +6,3 @@ { | ||
, "keywords": ["i18next", "gettext"] | ||
, "version": "0.0.5" | ||
, "version": "0.0.6" | ||
, "private": false | ||
@@ -9,0 +9,0 @@ , "preferGlobal": "true" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
112500
2593