{"name":"ajv-i18n","version":"4.0.0-beta.0","description":"Internationalised error messages for ajv JSON-Schema validator","main":"localize/index.js","scripts":{"build":"npm run build:json-schema && npm run build:jtd","build:json-schema":"node scripts/compile-locales.js '' index","build:jtd":"node scripts/compile-locales.js '/jtd' jtd","eslint":"eslint messages scripts spec/*.js","prepublish":"npm run build","test":"npm run prettier:check && npm run eslint && npm run build && npm run test-cov","test-spec":"mocha spec/*.spec.js -R dot","test-cov":"nyc npm run test-spec","prettier:write":"prettier --write \"./**/*.{json,yaml,js,ts}\"","prettier:check":"prettier --list-different \"./**/*.{json,yaml,js,ts}\""},"repository":{"type":"git","url":"git+https://github.com/epoberezkin/ajv-i18n.git"},"keywords":["ajv","JSON","schema","i18n","internationalisation"],"author":{"name":"Evgeny Poberezkin"},"license":"MIT","bugs":{"url":"https://github.com/epoberezkin/ajv-i18n/issues"},"homepage":"https://github.com/epoberezkin/ajv-i18n#readme","devDependencies":{"@ajv-validator/config":"^0.3.0","ajv":"^8.0.0-beta.4","ajv-formats":"^2.0.0-beta.2","ajv-keywords":"^5.0.0-beta.1","dot":"^1.0.3","eslint":"^7.8.1","eslint-config-prettier":"^8.1.0","husky":"^5.1.3","json-schema-test":"^2.0.0","lint-staged":"^10.5.4","mocha":"^8.0.1","nyc":"^15.0.0","prettier":"^2.2.1"},"peerDependencies":{"ajv":"^8.0.0-beta.0"},"nyc":{"exclude":["**/spec/**","node_modules"],"reporter":["lcov","text-summary"]},"prettier":"@ajv-validator/config/prettierrc.json","husky":{"hooks":{"pre-commit":"lint-staged && npm test"}},"lint-staged":{"*.{json,yaml,js,ts}":"prettier --write"},"gitHead":"4f7f3b9e579f2041a4c2e8ecf05762690521d5ba","readme":"# ajv-i18n\n\nInternationalised error messages for [Ajv](https://github.com/ajv-validator/ajv) - superfast JSON validator for JSON Schema and JSON Type Definition.\n\n[![Build Status](https://travis-ci.org/ajv-validator/ajv-i18n.svg?branch=master)](https://travis-ci.org/ajv-validator/ajv-i18n)\n[![npm](https://img.shields.io/npm/v/ajv-i18n.svg)](https://www.npmjs.com/package/ajv-i18n)\n[![Coverage Status](https://coveralls.io/repos/github/ajv-validator/ajv-i18n/badge.svg?branch=master)](https://coveralls.io/github/ajv-validator/ajv-i18n?branch=master)\n[![Gitter](https://img.shields.io/gitter/room/ajv-validator/ajv.svg)](https://gitter.im/ajv-validator/ajv)\n\n## Supported locales\n\n|locale|language |contributor|draft-04|draft-06<sup>1</sup>|draft-07<sup>2</sup>|draft<br>2019-09<sup>3</sup>|JTD<sup>4</sup>\n|------|:-------:|:---------:|:------:|:------:|:------:|:------:|:------:|\n|🇬🇧 en|English  | |✓|✓|✓|✓|✓|\n|AR ar|Arabic   |[Mahmoud-Mardeni](https://github.com/Mahmoud-Mardeni)|✓|✓|✓|-|-|\n|CA ca|Catalan   |[alexandreec](https://github.com/alexandreec)|✓|✓|✓|-|*|\n|🇨🇿 cs|Czech    |[kiskovacs](https://github.com/kiskovacs)<br>[NAM0007](https://github.com/NAM0007)|✓<br>&nbsp;|✓<br>&nbsp;|<br>✓|-|*|\n|🇩🇪 de|German   |[jmtoball](https://github.com/jmtoball)<br>[gflohr](https://github.com/gflohr)|✓<br>&nbsp;|✓<br>&nbsp;|<br>✓|✓<br>&nbsp;|✓<br>&nbsp;|\n|🇪🇸 es|Spanish  |[jpablom](https://github.com/jpablom)|✓|✓|✓|-|*|\n|🇫🇷 fr|French   |[monlouisj](https://github.com/monlouisj)<br>[Telokis](https://github.com/Telokis)|✓<br>&nbsp;|✓<br>&nbsp;|<br>✓|-|*|\n|🇭🇺 hu|Hungarian|[szilveszter9](https://github.com/szilveszter9)|✓|-|-|-|*|\n|🇮🇩 id|Indonesian|[ekoeryanto](https://github.com/ekoeryanto)|✓|✓|✓|-|*|\n|🇮🇹 it|Italian  |[jasoniangreen](https://github.com/jasoniangreen)<br>[lucacorti](https://github.com/lucacorti)|✓<br>&nbsp;|<br>✓|<br>✓|<br>✓|<br>✓|\n|🇯🇵 ja|Japanese |[gilgongo](https://github.com/gilgongo)|✓|-|-|-|*|\n|🇰🇷 ko|Korean |[MinByeongDon](https://github.com/MinByeongDon)|✓|✓|✓|-|*|\n|🇳🇴 nb|Norwegian bokmål|[mtramm](https://github.com/mtramm)|✓|✓|-|-|*|\n|🇳🇱 nl|Dutch    |[pimlie](https://github.com/pimlie)<br>[niekvb](https://github.com/niekvb)|✓|✓|✓|<br>✓|<br>✓|\n|🇵🇱 pl|Polish   |[danielzurawski](https://github.com/danielzurawski)|✓|-|-|-|*|\n|🇧🇷 pt-BR|Português - Brasil|[marcosrava](https://github.com/marcosrava)<br>[ggondim](https://github.com/ggondim)|✓|✓|✓|<br>✓|<br>✓|\n|🇷🇺 ru|Russian  | |✓|✓|✓|✓|✓|\n|🇸🇰 sk|Slovak   |[kiskovacs](https://github.com/kiskovacs)|✓|✓|-|-|*|\n|🇸🇪 sv|Swedish  |[limmen](https://github.com/Limmen)|✓|✓|-|-|*|\n|🇹🇭 th|Thai     |[encX](https://github.com/encX)|✓|✓|✓|✓|✓|\n|🇨🇳 zh|Chinese  |[jinzhubaofu](https://github.com/jinzhubaofu)<br>[leuction](https://github.com/leuction)|✓<br>&nbsp;|<br>✓|<br>✓|<br>✓|<br>✓|\n|🇹🇼 zh-TW|Chinese - Taiwan|[minipai](https://github.com/minipai)|✓|✓|✓|✓|✓|\n\n\n<sup>1</sup> added boolean schema, keywords `const`, `contains`, `propertyNames`\n\n<sup>2</sup> added keywords `if`/`then`/`else`\n\n<sup>3</sup> added keywords `unevaluatedProperties`, `unevaluatedItems`, `dependentRequired`\n\n<sup>4</sup> JSON Type Definition\n\n\\* `discriminator` form messages are not translated\n\nPlease contribute locales that you need to use if they are missing or incomplete.\n\n## Install\n\nUsing npm:\n\n```\nnpm install ajv-i18n\n```\n\n## Usage\n\nIn node:\n\n```javascript\nconst Ajv = require(\"ajv\") // version >= 8.0.0\nconst localize = require(\"ajv-i18n\")\n// or for JSON Type Definition\n// const localize = require(\"ajv-i18n/localize/jtd\")\n\nconst ajv = Ajv({allErrors: true, messages: false})\nconst validate = ajv.compile(schema)\nconst valid = validate(data)\n\nif (!valid) {\n  // ru for Russian\n  localize.ru(validate.errors)\n  // string with all errors and data paths\n  console.log(ajv.errorsText(validate.errors, {separator: '\\n'}))\n}\n```\n\nTo require only necessary locales (e.g., with browserify):\n\n```javascript\nconst localize_ru = require('ajv-i18n/localize/ru')\n// or for JSON Type Definition\n// const localize_ru = require('ajv-i18n/localize/ru/jtd')\n```\n\nor\n\n```javascript\nconst localize = {\n  en: require('ajv-i18n/localize/en'),\n  ru: require('ajv-i18n/localize/ru'),\n}\n```\n\nSee [Ajv docs](https://github.com/ajv-validator/ajv) for more information.\n\n## Tests\n\n```\nnpm install\ngit submodule update --init\nnpm test\n```\n\n## Contributing\n\nFunctions that localize error messages are generated using doT template [localize.jst](https://github.com/ajv-validator/ajv-i18n/tree/master/localize/localize.jst), [JSON Schema messages](https://github.com/ajv-validator/ajv-i18n/tree/master/messages/index.js) and [JSON Type Definition messages](https://github.com/ajv-validator/ajv-i18n/tree/master/messages/jtd.js). Templates are pre-compiled, so doT is not a run-time dependency.\n\n`npm run build` - compiles functions to [localize](https://github.com/ajv-validator/ajv/tree/master/localize) folder.\n\n## Contributors of locales\n\n[![danielzurawski](https://avatars3.githubusercontent.com/u/1625711?v=3&s=40)](https://github.com/danielzurawski \"danielzurawski\")\n[![szilveszter9](https://avatars0.githubusercontent.com/u/7540866?v=3&s=40)](https://github.com/szilveszter9 \"szilveszter9\")\n[![jmtoball](https://avatars0.githubusercontent.com/u/219950?v=3&s=40)](https://github.com/jmtoball \"jmtoball\")\n[![gilgongo](https://avatars2.githubusercontent.com/u/4561747?v=3&s=40)](https://github.com/gilgongo \"gilgongo\")\n[![jasoniangreen](https://avatars3.githubusercontent.com/u/3481367?v=3&s=40)](https://github.com/jasoniangreen \"jasoniangreen\")\n[![jpablom](https://avatars0.githubusercontent.com/u/3935083?v=3&s=40)](https://github.com/jpablom \"jpablom\")\n[![limmen](https://avatars2.githubusercontent.com/u/8254791?v=3&s=40)](https://github.com/Limmen \"Limmen\")\n[![jinzhubaofu](https://avatars2.githubusercontent.com/u/811195?v=3&s=40)](https://github.com/jinzhubaofu \"jinzhubaofu\")\n[![kiskovacs](https://avatars1.githubusercontent.com/u/2733311?v=3&s=40)](https://github.com/kiskovacs \"kiskovacs\")\n[![mahmoud-mardeni](https://avatars2.githubusercontent.com/u/19661270?s=40&v=3)](https://github.com/Mahmoud-Mardeni \"mahmoud-mardeni\")\n[![monlouisj](https://avatars0.githubusercontent.com/u/5998380?v=3&s=40)](https://github.com/monlouisj \"monlouisj\")\n[![marcosrava](https://avatars2.githubusercontent.com/u/243790?v=3&s=40)](https://github.com/marcosrava \"marcosrava\")\n[![mtramm](https://avatars3.githubusercontent.com/u/3519541?v=3&s=40)](https://github.com/mtramm \"mtramm\")\n[![Mahmoud-Mardeni](https://avatars3.githubusercontent.com/u/19661270?v=3&s=40)](https://github.com/Mahmoud-Mardeni \"Mahmoud-Mardeni\")\n[![leuction](https://avatars3.githubusercontent.com/u/8056270?v=3&s=40)](https://github.com/leuction \"leuction\")\n[![lucacorti](https://avatars2.githubusercontent.com/u/1076999?v=3&s=40)](https://github.com/lucacorti \"lucacorti\")\n[![minipai](https://avatars2.githubusercontent.com/u/239570?s=40&v=4)](https://github.com/minipai \"minipai\")\n[![encX](https://avatars3.githubusercontent.com/u/5965883?v=3&s=40)](https://github.com/encX \"encX\")\n[<img src=\"https://avatars3.githubusercontent.com/u/1067403?s=40&v=4\" alt=\"pimlie\" width=\"40px\"/>](https://github.com/pimlie \"pimlie\")\n[![MinByeongDon](https://avatars2.githubusercontent.com/u/6141807?s=40&v=4)](https://github.com/MinByeongDon \"MinByeongDon\")\n[![gflohr](https://avatars0.githubusercontent.com/u/7126580?s=40&v=4)](https://github.com/gflohr \"gflohr\")\n[![ekoeryanto](https://avatars2.githubusercontent.com/u/36023898?s=40&v=4)](https://github.com/ekoeryanto \"ekoeryanto\")\n[![Telokis](https://avatars3.githubusercontent.com/u/6382729?s=40&v=4)](https://github.com/Telokis \"Telokis\")\n[<img src=\"https://avatars3.githubusercontent.com/u/15526814?s=40&v=4\" alt=\"alexandreec\" width=\"40px\">](https://github.com/alexandreec \"alexandreec\")\n[![ggondim](https://avatars2.githubusercontent.com/u/2074685?s=40&v=4)](https://github.com/ggondim \"ggondim\")\n[![niekvb](https://avatars3.githubusercontent.com/u/37668320?s=40&v=4)](https://github.com/niekvb \"niekvb\")\n[![NAM0007](https://avatars1.githubusercontent.com/u/47188486?s=40&v=4)](https://github.com/NAM0007 \"NAM0007\")\n\n## Enterprise support\n\najv-i18n package is a part of [Tidelift enterprise subscription](https://tidelift.com/subscription/pkg/npm-ajv-i18n?utm_source=npm-ajv-i18n&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - it provides a centralised commercial support to open-source software users, in addition to the support provided by software maintainers.\n\n## Security contact\n\nTo report a security vulnerability, please use the\n[Tidelift security contact](https://tidelift.com/security).\nTidelift will coordinate the fix and disclosure. Please do NOT report security vulnerability via GitHub issues.\n\n## License\n\n[MIT](https://github.com/ajv-validator/ajv-i18n/blob/master/LICENSE)\n","readmeFilename":"README.md","_id":"ajv-i18n@4.0.0-beta.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-bpfEUGFG1pD/eiNjdO7bZYJGw8Eg9ii8rmodL7ZiIbNOUlAf2MAbHU7ZjGr9rzl7xwvZq9owekRdhcEXSsQG9g==","shasum":"b05f2fa2b1d598070d4f9d649c13eed65497cc9c","tarball":"http://registry-npm.ywwl.com/ajv-i18n/download/ajv-i18n-4.0.0-beta.0.tgz","fileCount":100,"unpackedSize":170140,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWkaDCRA9TVsSAnZWagAAMGgQAJfC8B736Xd16E0BEjkX\nsJosMUNV1yPnfsunh5PSjaTwx7PIScJbVQCbWPy3IwvkF5tvZi6ZAA5Pa/pl\nLcBc4/tRdPFQax0dmKfP4/3aYkBzexNZJXpmUmRmUOtZpuz3hEinmBARirav\naBIzcLXiJ5fQXWn5ZNWpmxi7xwFc/XAZAMUL6cc3ZMsAXOQgj3HosuJ7RMQT\n87qyl4bXm10j8rDnuzO1Mwx5HqTq2+vsfajfb8r7xOcYdBiuXK7AEop1Q9tB\ndWYSRnmm5CWteDa66ClnwW74uNYtkbXmVTO15tdS/ThIQoLNkoMdNgiPz3df\n9PnLP4QKNJXjW/DR844W2r60kE/umhv6RW99lpp1m/eke2f9rD9w6bPXA056\nbuMEkODACbXnNuAt05soNzEJMVi8oMJOpgdzCW40Rcr6fWCOtVBbK7e8Qsmn\ny2uc9SVrTizHGB/LFtvGgrotQf1dk9eilIWYOT8x2LMMW6o6tP9FlPZIAl5O\nnGwzVG5c+upREwyOQxFV3R8nDU3jhT/yQNE6zfXmWubBWU7AuVJ8Gq+yTeAl\nFwExxzSIM63cMY2WVPw3iv1LDubKJFyYxukxekRom8ueaBLv9xubJD8azY2i\n/HvFfQs7NUaBK9YiPHYHXwL/T68UPBydjMyMYotiyHEvdXxvFhKYJvWGlytt\nedqh\r\n=B8r2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHdl6eHthc0uojMUBQ2t+J38LZu5Zj3aI8w+kVJYVvXUAiEA3uUnwRTOali4TlIQRPspmVMF345GcNP+Ru3xQhqsBG4="}],"size":24102,"noattachment":false,"key":"/ajv-i18n/-/ajv-i18n-4.0.0-beta.0.tgz"},"_npmUser":{"name":"esp","email":"e.poberezkin@me.com"},"directories":{},"maintainers":[{"name":"esp","email":"e.poberezkin@me.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ajv-i18n_4.0.0-beta.0_1616529026905_0.26861717351005643"},"_hasShrinkwrap":false,"publish_time":1616529027075,"_cnpm_publish_time":1616529027075,"dist-tags":{"beta":"4.0.0-beta.0","latest":"4.2.0"}}