Skip to content

Commit

Permalink
added another kitty, closes #177
Browse files Browse the repository at this point in the history
  • Loading branch information
mashpie committed Feb 20, 2016
1 parent e671cae commit f98fa38
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ test:
cover:
istanbul cover ./node_modules/mocha/bin/_mocha

hint:
jshint --verbose .

examples:
for example in examples/*/test.js ; do \
mocha $$example; \
done

all: test examples
all: test examples hint

.PHONY: test examples
6 changes: 6 additions & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
"one": "%s cat",
"other": "%s cats"
},
"cats": {
"n": {
"one": "%s cat",
"other": "%s cats"
}
},
"nested": {
"deep": {
"plural": {
Expand Down
19 changes: 19 additions & 0 deletions test/i18n.plurals.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,4 +334,23 @@ describe('parsing plural intervals from strings', function() {
);
});

it('should resolve "Simpler dot notation for plurals #177"', function(){

should.equal(
pluralTest.__n('cats.n', 1),
'1 cat'
);

should.equal(
pluralTest.__n('cats.n', 2),
'2 cats'
);

should.equal(
pluralTest.__n('cats.n', 0),
'0 cats'
);

});

});

0 comments on commit f98fa38

Please sign in to comment.