{"name":"make-plural","version":"5.0.0-beta.1","description":"Unicode CLDR pluralization rules as JavaScript functions","keywords":["unicode","cldr","i18n","internationalization","pluralization"],"author":{"name":"Eemeli Aro","email":"eemeli@gmail.com"},"license":"ISC","homepage":"https://github.com/eemeli/make-plural#readme","repository":{"type":"git","url":"git+https://github.com/eemeli/make-plural.git","directory":"packages/plurals"},"bugs":{"url":"https://github.com/eemeli/make-plural/issues"},"main":"umd/plurals","scripts":{"build":"npm run es6 && npm run umd","es6":"npm run es6:plurals && npm run es6:plural-categories","es6:plurals":"../cli/make-plural -w118 --es6 > es6/plurals.js","es6:plural-categories":"../cli/make-plural --es6 --categories > es6/pluralCategories.js","umd":"npm run umd:plurals && npm run umd:plural-categories","umd:plurals":"../cli/make-plural -w118 > umd/plurals.js","umd:plural-categories":"../cli/make-plural --categories > umd/pluralCategories.js","version":"git add -f es6 umd"},"gitHead":"c477307d684359d5ede3071c0c2a2dddc351c60a","readme":"# make-plural\n\n`make-plural` provides JavaScript functions determining the pluralization categories of the approximately 200 languages included in the [Unicode CLDR].\n\nThe categorization functions are pre-compiled, require no runtime dependencies, and should compress to about 2.5kB. In order to generate an even smaller file from a subset of all possible language (or to drop ordinal plural support), use [make-plural-compiler].\n\n[unicode cldr]: http://cldr.unicode.org/\n[make-plural-compiler]: https://www.npmjs.com/package/make-plural-compiler\n\n## Installation & Usage\n\n```\nnpm install make-plural\n```\n\nThe \"main\" export `umd/plurals.js` contains an UMD module that can be included with node's `require` or AMD's `define`. In a browser environment, it will populate a global object `plurals`. Said module contains approximately 200 functions (one per [language]), each taking as a first parameter the value to be classified (either a number or a string), and as an optional second parameter, a boolean that if true, applies ordinal rather than cardinal rules.\n\n`umd/pluralCategories.js` has a similar structure to `umd/plurals.js`, but contains an array of the pluralization categories the cardinal and ordinal rules each language's pluralization function may output.\n\n`es6/plurals.js` and `es6/pluralCategories.js` are the ES6 module equivalents of the above.\n\nIf your language isn't directly included in the plural rules, try removing any trailing parts that are separated from the stem by `-` or `_`. Note also that the [capitalization of locale codes] is lowercase for the language, but uppercase for the country, so for example the code for Portugese as spoken in Portugal is `pt-PT`.\n\n[language]: http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html\n[capitalization of locale codes]: https://tools.ietf.org/html/bcp47#section-2.1.1\n\n```js\nvar plurals = require('make-plural')\n// { af: [Function],\n//   ak: [Function],\n//   am: [Function],\n// snip 193 lines...\n//   yo: [Function],\n//   zh: [Function],\n//   zu: [Function] }\n\nplurals.en(1) // 1st param is the value\n// 'one'\n\nplurals.en(2)\n// 'other'\n\nplurals.en(2, true) // 2nd param, if true-ish, is for ordinal rules\n// 'two'\n\nconsole.log(plurals.en.toString())\n// function (n, ord) {\n//   var s = String(n).split('.'), v0 = !s[1], t0 = Number(s[0]) == n,\n//       n10 = t0 && s[0].slice(-1), n100 = t0 && s[0].slice(-2);\n//   if (ord) return (n10 == 1 && n100 != 11) ? 'one'\n//       : (n10 == 2 && n100 != 12) ? 'two'\n//       : (n10 == 3 && n100 != 13) ? 'few'\n//       : 'other';\n//   return (n == 1 && v0) ? 'one' : 'other';\n// }\n\nvar pluralCategories = require('make-plural/umd/pluralCategories')\n// { af: { cardinal: [ 'one', 'other' ], ordinal: [ 'other' ] },\n//   ak: { cardinal: [ 'one', 'other' ], ordinal: [ 'other' ] },\n//   am: { cardinal: [ 'one', 'other' ], ordinal: [ 'other' ] },\n//   ar:\n//    { cardinal: [ 'zero', 'one', 'two', 'few', 'many', 'other' ],\n//      ordinal: [ 'other' ] },\n// snip 255 lines...\n//   zh: { cardinal: [ 'other' ], ordinal: [ 'other' ] },\n//   zu: { cardinal: [ 'one', 'other' ], ordinal: [ 'other' ] } }\n```\n","readmeFilename":"README.md","_id":"make-plural@5.0.0-beta.1","_nodeVersion":"11.9.0","_npmVersion":"lerna/3.15.0/node@v11.9.0+x64 (darwin)","dist":{"integrity":"sha512-qEhmIwrSEjRG11vovaqr0H3a/E4nI7qKEsDF5KuX5HgbqKh1rVzbTof4EQCT0VMK6kcYqVqWb55tWXZEkasTtQ==","shasum":"995d90dd7015b3626da0c492ca86717551a36672","tarball":"http://registry-npm.ywwl.com/make-plural/download/make-plural-5.0.0-beta.1.tgz","fileCount":8,"unpackedSize":61469,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdA8C2CRA9TVsSAnZWagAATk0QAIPLtyDv2scaOvZ1uOmk\nVHBekkHersz310+IZCWfgNpsNkZRsUJo1I5tGo/1QWOhUwDqPLs5/opBGOMR\n9X3N/HnO4S2Lbl4mmXk+BmV0MkXTmJ/4zg++aKZjijr/sV9xyn1xWRs50Cfq\nSpbEWX42Wyedc2o5puhpr3zX5fMzSkWgCQLvlz7ydARzM656lfunhUZvxtqz\nnXSs8MqODlD7kbvRj9AaaVpLNTd1qvuNBmN1ChIOisymQ3zJ23E0dhPsAM2H\nKjKgL5wnH1LdRcjIrHuH/OpunyL69NrL4wm3y9qlpuhl+fXj07kjdZxe4qKa\ndLLppwaqwYiveh/3jfj5sE6hXYRG4OaZQmw7q47EYiySdMaCcq7BT712xdfx\nDnmhzjPyll43Lq4DnaNHsIQutzNCTeSc6cfpDexI8lxJOdNGohmVJJTVJmKK\njX9HVuC0Lkj5ingCS0JFKVYMFqgtmObc/lMMwXpyMYp68sNTvv3cdCw/06+P\nzPK8kuABtaUOJJ/xLKW0CWgVzGkI/ucv5w9Hi9dE7vLOadupdlUyfbEX+Peb\njLxCDevN5t/IpGusv7oDdwT/eQuT6OSoubkgzv8smgD3es2DGQ1p0tN2tyal\nnLtbzT8y7ozAn46+giS30mFPuyyNabQph0mVohwgm6TIhKUj5JSij3PTt4Lo\nDWyE\r\n=ioP1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDo85EEH5jRY7zGbvR4K8K3SmYlVWGVZXFYUyAe+UI0iAIhALUMUzu83jj/z66mdWSg2VOmhq4aDxxRjioB533N1raL"}],"size":7745,"noattachment":false,"key":"/make-plural/-/make-plural-5.0.0-beta.1.tgz"},"maintainers":[{"name":"eemeli","email":"eemeli@gmail.com"}],"_npmUser":{"name":"eemeli","email":"eemeli@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/make-plural_5.0.0-beta.1_1560527029785_0.03059477538256905"},"_hasShrinkwrap":false,"publish_time":1560527029949,"_cnpm_publish_time":1560527029949,"dist-tags":{"latest":"8.2.0"}}