SlexAxton/messageformat.js — pull request #64 by eemeli (2014-09-22 00:05:58+00:00)
Title: Use make-plural for localization rule generation

This is a solution for issue #62, which removes the locale function determination from the included `locale/` folder and uses instead [make-plural](/eemeli/make-plural.js) ([npm](https://www.npmjs.org/package/make-plural)), a module I put together as a more generic solution.

make-plural takes the original Unicode CLDR [plural rules](http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html) in a JSON format, and returns executable JavaScript that is then included in the MessageFormat output. The generated function is automatically verified by make-plural by testing it against each of the included example values.

Unlike the current hard-coded rules in `locale/`, make-plural fully supports all languages for which plural rules are defined in the CLDR, and fully supports rules for non-integer values. The input value may also be a string, allowing for appropriate handling of e.g. "1.0 points".