Skip to content

Commit 76b1f1f

Browse files
committed
[1.0.1] - 2017-03-13
Changed --- - Fixed a bug where the string-based plural rules for evaluation fails.
1 parent 8acd028 commit 76b1f1f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

l10ns.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! l10n.js v1.0.0 */
1+
/*! l10n.js v1.0.1 */
22
/*
33
* l10n.js
44
*
@@ -123,7 +123,7 @@
123123
* On the other hand, if plural=(n==1), first cell should be "cat"
124124
* and second cell should be "cats".
125125
*/
126-
parsePlural = function (pluralForms) {
126+
parsePlural = function (pluralForms, n) {
127127
//n is used in eval()
128128
var re = /^nplurals=[0-9];\s*plural=\(([n!=><(?:\s+\|\|\s+)(?:\s+&&\s+)%0-9]{3,})\)/i,
129129
evalResult,
@@ -200,7 +200,7 @@
200200
}
201201
}
202202
if (pluralForms.indexOf('nplurals=2') !== -1) {
203-
position = parsePlural(pluralForms);
203+
position = parsePlural(pluralForms, cardinality);
204204
plural = getPlural(localizations[locale], position, this_val);
205205
//only return if plural form is found
206206
if (plural) {

0 commit comments

Comments
 (0)