{"name":"ajv-i18n","version":"4.2.0","description":"Internationalised error messages for Ajv JSON validator","main":"localize/index.js","types":"localize/index.d.ts","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","ajv-formats":"^2.0.0","ajv-keywords":"^5.0.0","dot":"^1.0.3","eslint":"^7.8.1","eslint-config-prettier":"^8.1.0","husky":"^7.0.1","json-schema-test":"^2.0.0","lint-staged":"^11.1.1","mocha":"^9.0.3","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":"866e21752b9531c39d4a24e6fe15cc17f94b7f75","_id":"ajv-i18n@4.2.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-v/ei2UkCEeuKNXh8RToiFsUclmU+G57LO1Oo22OagNMENIw+Yb8eMwvHu7Vn9fmkjJyv6XclhJ8TbuigSglPkg==","shasum":"d48750ba60e283b3dee31e3c22c8c9f7410e326f","tarball":"http://registry-npm.ywwl.com/ajv-i18n/download/ajv-i18n-4.2.0.tgz","fileCount":104,"unpackedSize":188380,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2jKYCRA9TVsSAnZWagAAEOgP/37BoMOb5zeEmLDKHB2y\nHqLlKaNVvshvJueS4zQe4slmJiuva1dhti/jtJUwIwVDP32Jo+GKmIdz0S0Y\nJjm9ACDs5JryQySGeMPylW/sQxUSgv6gIkwdCHfZ2oDfYgcQqeSRB4kmTBdF\ni68hS8OqvGhvM1R+lUqY2j6pjxaKahl2f4wCarJlzh/Ob4+lBgS77EcBldVR\nHkULkNRqwP6w4C5mXqoM6yPhioEj8JBtnQtV/ZwCb0RlGzaFJ7rNdGmxpOfR\ng8goAwsiOxR8ktbHD6MmRMwM+wf1/4ypFsSkCWalErSIyvfxmtnxvAOHdMG3\nTFymr0nRmDFRzJcNcoh8HtQkr39nRe1et4XR3ai5FX0YSZZBkuZiGxa0uPVJ\n4IDHiL6DLU8GFv4O4JkltACcPvnOzcfucUQSZr5UqxL1Y1GLdeLf9XS7KBUz\nhX8ofzSyYM/rBDZtJKUsVRb1YTEc4GCzUr9Xt3Kkv/cYhqdjosWtSd8lhOBf\njTX9Qj836YJae79obu9abk2qQLOU5ewRyDy8HKswtWe1jNzXYNxzZBgrId5P\nlQs7kR3+C5e7OqRG88G4m5OPbS4uuDsJQej5HQT+2jY8FwGuwsZylulR6iv1\nbFvcR0+6ejAqR92Rl7rfK5l7EOhMQOTPCdEZ+4FzJs+LvPwPgb0svnkXbEzn\nuKg1\r\n=M3qH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDDDj7AsxWqqEpuL977Fw84k3cTSivV3sFXPAdGU9BWKAIhANlD2FB42vGMFHWaQUj61REXtiYjOEI+/OA2CpC5SyoH"}],"size":25980,"noattachment":false,"key":"/ajv-i18n/-/ajv-i18n-4.2.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.2.0_1636405564307_0.21689826624780206"},"_hasShrinkwrap":false,"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><br>/2020-12<sup>4</sup>|JTD<sup>5</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|🇫🇮 fi|Finnish  |[saulipurhonen](https://github.com/saulipurhonen)|✓|✓|✓|✓|✓|\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 messages for keywords `unevaluatedProperties`, `unevaluatedItems`, `dependentRequired`\n\n<sup>4</sup> keyword `items` messages\n\n<sup>5</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[![saulipurhonen](https://avatars.githubusercontent.com/u/48789543?s=40&v=4)](https://github.com/saulipurhonen \"saulipurhonen\")\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","publish_time":1636405564536,"_cnpm_publish_time":1636405564536,"dist-tags":{"beta":"4.0.0-beta.0","latest":"4.2.0"}}