Skip to content

Commit b526d08

Browse files
authored
getPluralIndex return value bug fixed
After reading the gnu doc: https://www.gnu.org/savannah-checkouts/gnu/gettext/manual/html_node/Plural-forms.html (Note: this uses the feature of C expressions that boolean expressions have to value zero or one) This is the correct fix.
1 parent df909a9 commit b526d08

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/translator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@
172172
plurals[domain].fn = new Function('n', plurals[domain].code);
173173
}
174174

175-
return plurals[domain].fn.call(this, value) ? 1 : 0;
175+
return plurals[domain].fn.call(this, value) + 0;
176176
}
177177

178178
function mergeTranslations(translations, newTranslations) {

0 commit comments

Comments
 (0)