{"name":"messageformat","version":"2.0.0-beta.3","description":"PluralFormat and SelectFormat Message and i18n Tool - A JavaScript Implemenation of the ICU standards.","keywords":["i18n","pluralformat","icu","gettext","choiceformat","selectformat","messageformat","internationalization"],"author":{"name":"Alex Sexton","email":"alexsexton@gmail.com"},"contributors":[{"name":"Eemeli Aro","email":"eemeli@gmail.com"}],"license":"MIT","homepage":"https://messageformat.github.io/","repository":{"type":"git","url":"git+https://github.com/messageformat/messageformat.js.git"},"main":"lib/index.js","files":["doc","example","lib","messageformat.js","messageformat.min.js","messageformat.min.js.map"],"dependencies":{"make-plural":"^4.1.1","messageformat-parser":"^3.0.0-beta.2","reserved-words":"^0.1.2"},"devDependencies":{"browserify":"^13.3.0","expect.js":"*","jsdoc":"^3.5.5","mocha":"~3.0.2","serve":"^6.4.3","tmp":"0.0.33","uglify-js":"^2.8.29"},"scripts":{"prepublish":"make all","test":"mocha"},"browser":{"fs":false},"readme":"<img align=\"right\" width=\"100\" height=\"100\" src=\"logo/messageformat.svg\">\n\n[![Build Status](https://secure.travis-ci.org/messageformat/messageformat.js.svg)](http://travis-ci.org/messageformat/messageformat.js)\n\n# messageformat\n\nThe experience and subtlety of your program's text can be important. ICU MessageFormat is a mechanism for handling both **pluralization** and **gender** in your applications. It can also lead to much better translations, as it's designed to support [all the languages](http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html) included in the [Unicode CLDR](http://cldr.unicode.org/).\n\nThe ICU has an [official guide](http://userguide.icu-project.org/formatparse/messages) for the format. Messageformat supports and extends all parts of the [standard](http://icu-project.org/apiref/icu4j/com/ibm/icu/text/MessageFormat.html), with the exception of the deprecated ChoiceFormat.\n\nThere is a good slide-deck on [Plural and Gender in Translated Messages](https://docs.google.com/presentation/d/1ZyN8-0VXmod5hbHveq-M1AeQ61Ga3BmVuahZjbmbBxo/pub?start=false&loop=false&delayms=3000#slide=id.g1bc43a82_2_14) by Markus Scherer and Mark Davis. But, again, remember that many of these problems apply even if you're only outputting english.\n\nPlease see [messageformat.github.io](https://messageformat.github.io/) for a guide to MessageFormat, more information on on the build-time use of messageformat, and the code documentation.\n\n\n## What problems does it solve?\n\nUsing messageformat, you can separate your code from your text formatting, while enabling much more humane expressions. In other words, you won't need to see this anymore in your output:\n\n> There are 1 results.  \n> There are 1 result(s).  \n> Number of results: 5.\n\n\n## What does it look like?\n\nWith this message:\n\n```js\n> const msg = `{GENDER, select, male{He} female{She} other{They} } found\n  {RES, plural, =0{no results} one{1 result} other{# results} } in the\n  {CAT, selectordinal, one{#st} two{#nd} few{#rd} other{#th} } category.`;\n```\n\nYou'll get these results:\n\n```js\n> const mfunc = new MessageFormat('en').compile(msg);\n\n> mfunc({ GENDER: 'male', RES: 1, CAT: 2 })\n'He found 1 result in the 2nd category.'\n\n> mfunc({ GENDER: 'female', RES: 1, CAT: 2 })\n'She found 1 result in the 2nd category.'\n\n> mfunc({ GENDER: 'male', RES: 2, CAT: 1 })\n'He found 2 results in the 1st category.'\n\n> mfunc({ RES: 2, CAT: 2 })\n'They found 2 results in the 2nd category.'\n```\n\n\n## Features\n\n* Handles arbitrary nesting of pluralization and select rules\n* Supports all ~466 languages included in the Unicode CLDR\n* Works on the server and the client\n* Remarkably useful even for single-language use\n* Speed & efficiency: Can pre-compile messages to JavaScript code\n  * Great for speed: message formatting is just string concatenation\n* Compatible with other MessageFormat implementations\n* Extendable with custom formatting functions\n* Very whitespace tolerant\n* Supports Unicode\n\n\n## Installation\n\n### Node\n```\nnpm install messageformat\n```\n\n```js\nconst MessageFormat = require('messageformat');\nconst mf = new MessageFormat('en');\n```\n\n### Bower\n```\nbower install messageformat\n```\n\n```html\n<script src=\"path/to/bower_components/messageformat/messageformat.js\"></script>\n<script>\n  const mf = new MessageFormat('en');\n</script>\n```\n\n### Git / Direct download\nThe tagged [releases](https://github.com/messageformat/messageformat.js/releases) available on github.com include all of the compiled files that are kept off the master branch of the repository. When working with a clone of the repository, you'll likely want to run `make all` to generate them yourself.\n\n\n## License\n\nYou may use this software under the MIT License.\n\n## Contributor License Agreement\n\nWe require all contributions to be covered under the JS Foundation's [Contributor License Agreement](https://js.foundation/CLA/). This can be done electronically and essentially ensures that you are making it clear that your contributions are your contributions, you have the legal right to contribute and you are transferring the copyright of your works to the JavaScript Foundation.\n\nIf you are an unfamiliar contributor to the committer assessing your pull request, it is best to make it clear how you are covered by a CLA in the notes of the pull request. The committer will verify your status.\n\nIf your GitHub user id you are submitting your pull request from differs from the e-mail address which you have signed your CLA under, you should specifically note what you have your CLA filed under (and for CCLA that you are listed under your company's authorised contributors).\n\n## Authors\n\n* Alex Sexton - [@SlexAxton](http://twitter.com/SlexAxton) - <http://alexsexton.com/>\n* Eemeli Aro - [@eemeli](http://twitter.com/eemeli_aro) - <https://github.com/eemeli>\n\n\n## Credits\n\nThanks to:\n\n* [Bazaarvoice](https://github.com/Bazaarvoice) - Alex's previous employer - for letting him do cool stuff like this.\n* Google has an implementation that is similar in Google Closure, I tried to vet my code against many of their tests.\n* Norbert Lindenberg for showing how good it can be.\n\n\n## Implementations in other languages\n\n[Jeff Hansen](https://github.com/jeffijoe) ([@jeffijoe](https://twitter.com/jeffijoe)) has written an [implementation for .NET](https://github.com/jeffijoe/messageformat.net) - it's a Portable Class Library, making it possible to use on iOS, Android, Windows Phone, and pretty much any other .NET target.\n\n\n## Additional tools\n\n[icu-converter](https://github.com/alex-dow/icu-converter) is a NodeJS tool for converting message files in the [ICU Resource Bundle](http://userguide.icu-project.org/locale/resources) format into JSON or .property files.\n","readmeFilename":"README.md","gitHead":"44a8bdb2ae15d6be8b8058ec571cd41625e59bf8","bugs":{"url":"https://github.com/messageformat/messageformat.js/issues"},"_id":"messageformat@2.0.0-beta.3","_npmVersion":"5.6.0","_nodeVersion":"9.5.0","_npmUser":{"name":"eemeli","email":"eemeli@gmail.com"},"dist":{"integrity":"sha512-suYfZ1UtHIThRWtRmC6baCHDWZUNzdR2wsdXcKR/mKUwm13wMy/ZknqXUSVAeULBbeAl7XEIN/c6lyCG69odRA==","shasum":"649758134bc3096bea9daf8cea414346ba36a585","tarball":"http://registry-npm.ywwl.com/messageformat/download/messageformat-2.0.0-beta.3.tgz","fileCount":45,"unpackedSize":508604,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC84dl57ZScDVWLO9xdAButMF9NRjddF82VK08i7WSA+QIhANuiIkTEOxT2R726qirIu3qhSZUnGTngCu+tKCGaS79e"}],"size":120599,"noattachment":false,"key":"/messageformat/-/messageformat-2.0.0-beta.3.tgz"},"maintainers":[{"name":"eemeli","email":"eemeli@gmail.com"},{"name":"slexaxton","email":"alexsexton@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messageformat_2.0.0-beta.3_1521792862188_0.40199127238165766"},"_hasShrinkwrap":false,"deprecated":"Package renamed as '@messageformat/core', see messageformat.github.io for more details. 'messageformat@4' will eventually provide a polyfill for Intl.MessageFormat, once it's been defined by Unicode & ECMA.","publish_time":1521792862263,"_cnpm_publish_time":1521792862263,"dist-tags":{"latest":"4.1.0"}}