nodeca/babelfish — pull request #8 by elmigranto (2012-12-22 06:37:22+00:00)
Title: fix: #7: Zero-count in plurals.

Fixes #7: Zero-count in plurals.

Since `achor` was already checked for being `undefined`, I see no reason to use `String(anchor || '')` instead of just `String(anchor)`. Otherwise, it will produce wrong result at parameters like `false`, `''`, `null` and, mostly important, `0`.

I also want to discuss changing check from `typeof` to `.hasOwnProperty()` since `undefined` could also be wanted in the translated string.