{"name":"messageformat","version":"3.0.0-beta.1","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/messageformat/","repository":{"type":"git","url":"git+https://github.com/messageformat/messageformat.git"},"main":"index.js","browser":"./messageformat.js","babel":{"presets":[["@babel/preset-env",{"targets":{"node":"6.5.0"}}]],"plugins":[["@babel/plugin-proposal-class-properties",{"loose":true}]]},"eslintConfig":{"env":{"commonjs":true,"es6":true},"overrides":[{"files":["src/*.js"],"parser":"babel-eslint"},{"files":["webpack.config.js"],"env":{"node":true}}]},"dependencies":{"make-plural":"^6.0.0-beta.3","messageformat-parser":"^4.1.2","messageformat-runtime":"^3.0.0-beta.0","safe-identifier":"^0.2.0"},"scripts":{"prebuild":"babel src -d lib","build":"webpack --mode none"},"gitHead":"50213d12a076cb9e844634ec018e9992b68f8eff","readme":"<div class=\"main-title\">\n<img align=\"right\" width=\"100\" height=\"100\" src=\"https://messageformat.github.io/messageformat/logo/messageformat.svg\">\n<a class=\"badge\" href=\"http://travis-ci.org/messageformat/messageformat\"><img src=\"https://secure.travis-ci.org/messageformat/messageformat.svg\" alt=\"Build Status\"></a>\n<h1>messageformat</h1>\n</div>\n\nThe experience and subtlety of your program's text can be important. 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\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.<br>\n> There are 2 result(s).<br>\n> Number of results: 3.\n\nOn a more fundamental level, messageformat and its associated tools can help you build an effective workflow for UI texts and translations, keeping message sources in human-friendly formats, compiling them into JavaScript during your build phase, and making them easy to use from your application code.\n\n## What does it look like?\n\nWith this message:\n\n```js\nconst msgSrc = `{GENDER, select,\n  male {He}\n  female {She}\n  other {They}\n} found {RES, plural,\n  =0 {no results}\n  one {1 result}\n  other {# results}\n}.`;\n```\n\nYou'll get these results:\n\n```js\nconst MessageFormat = require('messageformat');\nconst mf = new MessageFormat('en');\nconst msg = mf.compile(msgSrc);\n\nmsg({ GENDER: 'male', RES: 1 }); // 'He found 1 result.'\nmsg({ GENDER: 'female', RES: 1 }); // 'She found 1 result.'\nmsg({ GENDER: 'male', RES: 0 }); // 'He found no results.'\nmsg({ RES: 2 }); // 'They found 2 results.'\n```\n\n## Getting Started\n\n```\nnpm install --save-dev messageformat\nnpm install --save messageformat-runtime\n```\n\nThis includes the MessageFormat compiler and a runtime accessor class that provides a slightly nicer API for working with larger numbers of messages. Our [Format Guide] will help with the ICU MessageFormat Syntax, and the [Usage Guide] provides some options for integrating messageformat to be a part of your workflow around UI texts and translations.\n\n[format guide]: https://messageformat.github.io/messageformat/page-guide\n[usage guide]: https://messageformat.github.io/messageformat/page-build\n\n---\n\n[Messageformat](https://messageformat.github.io/) is an OpenJS Foundation project, and we follow its [Code of Conduct](https://github.com/openjs-foundation/cross-project-council/blob/master/CODE_OF_CONDUCT.md).\n\n<a href=\"https://openjsf.org\">\n<img width=200 alt=\"OpenJS Foundation\" src=\"https://messageformat.github.io/messageformat/logo/openjsf.svg\" />\n</a>\n\nBrowser testing provided by:\n\n<a href=\"https://www.browserstack.com/open-source\">\n<img width=200 alt=\"BrowserStack\" src=\"https://messageformat.github.io/messageformat/logo/browserstack.svg\" />\n</a>\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/messageformat/messageformat/issues"},"_id":"messageformat@3.0.0-beta.1","_nodeVersion":"10.16.3","_npmVersion":"lerna/3.17.0/node@v10.16.3+x64 (darwin)","dist":{"integrity":"sha512-QXPnB/xftFWfs9zSg0mk55Zh6JbGPtvCc62mMlpg2gCRqP8NUcIOuVfCxzWtuU/3AkluivdRpTd+gxnMALuoaQ==","shasum":"3afeadb41e3bdf3536bba55c8fb222a35975c030","tarball":"http://registry-npm.ywwl.com/messageformat/download/messageformat-3.0.0-beta.1.tgz","fileCount":14,"unpackedSize":472119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdpiYwCRA9TVsSAnZWagAAPAwP/0HepcfGhTtnNpCgTxKS\nZiC4a9tWMrDgdmZMQLKeZ7kyiHWFkBiM9oCUl6shvgTGEUFz6JwdE20bmqXL\nPS+KuGu/wL6tHfBvLqczoze2rI0yijQ2mbL3Fk+JvsZQHMcoPPY5/7hvrsO3\ndNCHjer9zpEj9slKBQ+G8eUiXzBDpVFDOyNEwhTHHcLQpyPV4BUrTUOIMH6Y\nsdB2KDtJrxXTUqC9Onyb2aQ+QW32qDxGfQvlVL/TS8fBWXFLS64iHgDAZI3T\nKNABMlk9tzBb7bXGX218qHxjup/hB0espfDmg8ic2yeYhvcV96UN8t0QFOTX\nyh5cthyRTfzA+FQm8NuTPfvHTq+phQbbBmY3Uht6bHbp/hZPoKHPZiiW38gf\nESUmtVkcHsmK4M4CNUb8nq7vQjWkgu/w5C6sTpopc1Ai47jZzHoXMRB5IZ3u\n3GGwgbf+Pdgl0gasFSH+lZ8KsS/qatsbgABq4sI1CPKmphM0Q/oH12tdFWtf\nPNyFdJ9JMZq47otc/m7Znc2stUxkorvyPzdwaFiT80UTTTzXXcFofeVXviAA\nsGqSHkWsxcrAGBe6g2/ZAtn8DF7dgJUw2XSG9dLVYyjpYuOL99la8O3A6o7P\ndWEQpMg7eKKQRz1tsKWyhV1L36G70U43qUjA7UjYSDD2hokXMfrSEgCt5Jou\nMnAf\r\n=/+1j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCpbiH09Cj9y+/oTi0CNEelm65z5S5HfXqzDXIArKWLtgIgC4h/pWygE+9ABRN9E3hpgb4civkPU0WQLAOPFxeUVm4="}],"size":76428,"noattachment":false,"key":"/messageformat/-/messageformat-3.0.0-beta.1.tgz"},"maintainers":[{"name":"eemeli","email":"eemeli@gmail.com"},{"name":"slexaxton","email":"alexsexton@gmail.com"}],"_npmUser":{"name":"eemeli","email":"eemeli@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/messageformat_3.0.0-beta.1_1571169839692_0.8121795831789607"},"_hasShrinkwrap":false,"publish_time":1571169839806,"_cnpm_publish_time":1571169839806,"dist-tags":{"latest":"4.1.0"}}