Skip to content

Commit cf47e9e

Browse files
committed
make plural-forms optional
1 parent 81c2d1f commit cf47e9e

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/translator.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,14 @@
3838
return this;
3939
}
4040

41-
var plural = translations['plural-forms'].split(';', 2);
41+
if (translations['plural-forms']) {
42+
var plural = translations['plural-forms'].split(';', 2);
4243

43-
this.plurals[domain] = {
44-
count: parseInt(plural[0].replace('nplurals=', '')),
45-
code: plural[1].replace('plural=', 'return ') + ';'
46-
};
44+
this.plurals[domain] = {
45+
count: parseInt(plural[0].replace('nplurals=', '')),
46+
code: plural[1].replace('plural=', 'return ') + ';'
47+
};
48+
}
4749

4850
this.dictionary[domain] = translations.messages;
4951

0 commit comments

Comments
 (0)