{"_id":"@alesmenzel/ajv-i18n","_rev":"2-58e45853f8fc8e914e03bef6e5eca7a4","name":"@alesmenzel/ajv-i18n","description":"Internationalised error messages for ajv JSON-Schema validator","dist-tags":{"latest":"2.0.4"},"versions":{"2.0.4":{"name":"@alesmenzel/ajv-i18n","version":"2.0.4","description":"Internationalised error messages for ajv JSON-Schema validator","main":"localize/index.js","files":["localize/","LICENSE"],"scripts":{"build":"node scripts/compile-locales.js","bundle-all":"npm run browserify && npm run uglify","bundle-test":"npm run browserify-test && npm run uglify-test","browserify":"mkdir -p dist/ && browserify -r ./localize/index -o dist/ajv-i18n.bundle.js","browserify-test":"mkdir -p dist/ && browserify -r ./node_modules/ajv/lib/ajv.js:ajv -r ./localize/index -o dist/ajv-i18n.test.bundle.js","uglify":"uglifyjs ./dist/ajv-i18n.bundle.js -o ./dist/ajv-i18n.min.js -m -c --warn","uglify-test":"uglifyjs ./dist/ajv-i18n.test.bundle.js -o ./dist/ajv-i18n.test.min.js -m -c --warn","prepublish":"npm run build","test":"npm run build && npm run test-cov && npm run test-browser","test-spec":"mocha spec/*.spec.js -R spec","test-cov":"nyc npm run test-spec","test-browser":"npm run bundle-test && scripts/prepare-tests && karma start --single-run --browsers PhantomJS"},"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":"^5.1.5","ajv-keywords":"^2.1.0","brfs":"^1.4.3","browserify":"^14.1.0","coveralls":"^2.11.16","dot":"^1.0.3","js-beautify":"^1.5.10","json-schema-test":"^1.3.0","karma":"^1.5.0","karma-mocha":"^1.3.0","karma-phantomjs-launcher":"^1.0.0","mocha":"^3.2.0","nyc":"^10.1.2","phantomjs-prebuilt":"^2.1.4","pre-commit":"^1.1.1","require-globify":"^1.3.0","uglify-js":"^3.0.10"},"peerDependencies":{"ajv":">=5.0.0"},"nyc":{"exclude":["**/spec/**","node_modules"],"reporter":["lcov","text-summary"]},"gitHead":"5670b3746528d17040d30511d521f7c941d1c003","_id":"@alesmenzel/ajv-i18n@2.0.4","_shasum":"d247358283921604659bcdeaacf01b813451d93c","_from":".","_npmVersion":"4.5.0","_nodeVersion":"7.9.0","_npmUser":{"name":"alesmenzel","email":"alesmenzel@gmail.com"},"dist":{"shasum":"d247358283921604659bcdeaacf01b813451d93c","tarball":"https://registry.npmjs.org/@alesmenzel/ajv-i18n/-/ajv-i18n-2.0.4.tgz","integrity":"sha512-WXSvJc9u+PhROKPyu81fjsgt5Xtop1uWVHfkDcDS6ZmwfLOC/59yDtFimoHErrLLZ1hdrf2A7jZ9eGzFgfDp7A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCnr6AScokpg6BieWAa9rEKIXzQhumMJrjlxLGrluLRrAIgb5miAef3jNnLICfa0Wpal39Fkj9TymkBq5cOrMkfZZo="}]},"maintainers":[{"name":"alesmenzel","email":"alesmenzel@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ajv-i18n-2.0.4.tgz_1497024016694_0.12439661659300327"}}},"readme":"# ajv-i18n\r\n\r\nInternationalised error messages for [Ajv](https://github.com/epoberezkin/ajv) - currently the fastest JSON-Schema validator\r\n\r\n[![Build Status](https://travis-ci.org/epoberezkin/ajv-i18n.svg?branch=master)](https://travis-ci.org/epoberezkin/ajv-i18n)\r\n[![npm version](https://badge.fury.io/js/ajv-i18n.svg)](http://badge.fury.io/js/ajv-i18n)\r\n[![Coverage Status](https://coveralls.io/repos/github/epoberezkin/ajv-i18n/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/ajv-i18n?branch=master)\r\n[![Greenkeeper badge](https://badges.greenkeeper.io/epoberezkin/ajv-i18n.svg)](https://greenkeeper.io/)\r\n[![Gitter](https://img.shields.io/gitter/room/ajv-validator/ajv.svg)](https://gitter.im/ajv-validator/ajv)\r\n\r\n\r\n## Supported locales\r\n\r\n|locale|language |contributor|draft-04|Ajv v5<sup>\\*</sup>|draft-06|\r\n|------|:-------:|:---------:|:------:|:------:|:------:|\r\n|🇬🇧 en|English  | |✓|✓|✓|\r\n|🇨🇿 cz|Czech    |[kiskovacs](https://github.com/kiskovacs)|✓|✓|✓|\r\n|🇩🇪 de|German   |[jmtoball](https://github.com/jmtoball)|✓|✓|✓|\r\n|🇪🇸 es|Spanish  |[jpablom](https://github.com/jpablom)|✓|✓|-|\r\n|🇫🇷 fr|French   |[monlouisj](https://github.com/monlouisj)|✓|✓|-|\r\n|🇭🇺 hu|Hungarian|[szilveszter9](https://github.com/szilveszter9)|✓|-|-|\r\n|🇮🇹 it|Italian  |[jasoniangreen](https://github.com/jasoniangreen)|✓|-|-|\r\n|🇯🇵 ja|Japanese |[gilgongo](https://github.com/gilgongo)|✓|-|-|\r\n|🇵🇱 pl|Polish   |[danielzurawski](https://github.com/danielzurawski)|✓|✓|-|\r\n|🇧🇷 pt-BR|Português - Brasil|[marcosrava](https://github.com/marcosrava)|✓|✓|-|\r\n|🇷🇺 ru|Russian  | |✓|✓|✓|\r\n|🇸🇰 sk|Slovak   |[kiskovacs](https://github.com/kiskovacs)|✓|✓|✓|\r\n|🇸🇪 sv|Swedish  |[limmen](https://github.com/Limmen)|✓|✓|✓|\r\n|🇨🇳 zh|Chinese  |[jinzhubaofu](https://github.com/jinzhubaofu)|✓|✓|-|\r\n\r\n<sup>\\*</sup> v5 is a special mode in Ajv version 4.x.x\r\n\r\nPlease contribute locales that you need to use if they are missing or incomplete.\r\n\r\n\r\n## Install\r\n\r\nUsing npm:\r\n\r\n```\r\nnpm install ajv-i18n\r\n```\r\n\r\nUsing bower:\r\n\r\n```\r\nbower install ajv-i18n\r\ncd bower_components/ajv-i18n\r\nnpm install && npm run bundle-all\r\n```\r\n\r\n## Usage\r\n\r\nIn node:\r\n\r\n```javascript\r\nvar Ajv = require('ajv'); // version >= 2.0.0\r\nvar localize = require('ajv-i18n');\r\n\r\n// option `i18n` is required for this package to work\r\nvar ajv = Ajv({ allErrors: true });\r\nvar validate = ajv.compile(schema);\r\nvar valid = validate(data);\r\n\r\nif (!valid) {\r\n    // ru for Russian\r\n    localize.ru(validate.errors);\r\n    // string with all errors and data paths\r\n    console.log(ajv.errorsText(validate.errors, { separator: '\\n' }));\r\n}\r\n```\r\n\r\nTo require only necessary locales in browser (with browserify):\r\n\r\n```javascript\r\nvar localize_ru = require('ajv-i18n/localize/ru');\r\n```\r\n\r\nor\r\n\r\n```javascript\r\nvar localize = {\r\n    en: require('ajv-i18n/localize/en'),\r\n    ru: require('ajv-i18n/localize/ru')\r\n};\r\n```\r\n\r\nSee [Ajv docs](https://github.com/epoberezkin/ajv) for more information.\r\n\r\n\r\n## Tests\r\n\r\n```\r\nnpm install\r\ngit submodule update --init\r\nnpm test\r\n```\r\n\r\n\r\n## Contributing\r\n\r\nFunctions that localize error messages are generated using doT templates in [messages](https://github.com/epoberezkin/ajv-i18n/tree/master/messages/index.js) and [localize.jst](https://github.com/epoberezkin/ajv-i18n/tree/master/localize/localize.jst) template. Templates are precompiled so doT is not a run-time dependency.\r\n\r\n`npm run build` - compiles functions to [localize](https://github.com/epoberezkin/ajv/tree/master/localize) folder.\r\n\r\n\r\n## Contributors of locales\r\n\r\n[![danielzurawski](https://avatars3.githubusercontent.com/u/1625711?v=3&s=40)](https://github.com/danielzurawski \"danielzurawski\")\r\n[![szilveszter9](https://avatars0.githubusercontent.com/u/7540866?v=3&s=40)](https://github.com/szilveszter9 \"szilveszter9\")\r\n[![jmtoball](https://avatars0.githubusercontent.com/u/219950?v=3&s=40)](https://github.com/jmtoball \"jmtoball\")\r\n[![gilgongo](https://avatars2.githubusercontent.com/u/4561747?v=3&s=40)](https://github.com/gilgongo \"gilgongo\")\r\n[![jasoniangreen](https://avatars3.githubusercontent.com/u/3481367?v=3&s=40)](https://github.com/jasoniangreen \"jasoniangreen\")\r\n[![jpablom](https://avatars0.githubusercontent.com/u/3935083?v=3&s=40)](https://github.com/jpablom \"jpablom\")\r\n[![limmen](https://avatars2.githubusercontent.com/u/8254791?v=3&s=40)](https://github.com/Limmen \"Limmen\")\r\n[![jinzhubaofu](https://avatars2.githubusercontent.com/u/811195?v=3&s=40)](https://github.com/jinzhubaofu \"jinzhubaofu\")\r\n[![kiskovacs](https://avatars1.githubusercontent.com/u/2733311?v=3&s=40)](https://github.com/kiskovacs \"kiskovacs\")\r\n[![monlouisj](https://avatars0.githubusercontent.com/u/5998380?v=3&s=40)](https://github.com/monlouisj \"monlouisj\")\r\n[![marcosrava](https://avatars2.githubusercontent.com/u/243790?v=3&s=40)](https://github.com/marcosrava \"marcosrava\")\r\n\r\n\r\n## License\r\n\r\n[MIT](https://github.com/epoberezkin/ajv-i18n/blob/master/LICENSE)\r\n","maintainers":[{"name":"alesmenzel","email":"alesmenzel@gmail.com"}],"time":{"modified":"2022-06-12T14:27:57.974Z","created":"2017-06-09T16:00:17.572Z","2.0.4":"2017-06-09T16:00:17.572Z"},"homepage":"https://github.com/epoberezkin/ajv-i18n#readme","keywords":["ajv","JSON","schema","i18n","internationalisation"],"repository":{"type":"git","url":"git+https://github.com/epoberezkin/ajv-i18n.git"},"author":{"name":"Evgeny Poberezkin"},"bugs":{"url":"https://github.com/epoberezkin/ajv-i18n/issues"},"license":"MIT","readmeFilename":"README.md"}