{"id":15152784,"url":"https://github.com/ajv-validator/ajv-i18n","last_synced_at":"2025-04-06T17:11:57.913Z","repository":{"id":36962943,"uuid":"42142287","full_name":"ajv-validator/ajv-i18n","owner":"ajv-validator","description":"Internationalised error messages for Ajv JSON schema validator","archived":false,"fork":false,"pushed_at":"2024-01-19T17:37:50.000Z","size":419,"stargazers_count":171,"open_issues_count":27,"forks_count":90,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-29T22:56:35.387Z","etag":null,"topics":["ajv","i18n","internationalization","json-schema","validator"],"latest_commit_sha":null,"homepage":"https://ajv.js.org","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ajv-validator.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":"epoberezkin","tidelift":"npm/ajv-i18n"}},"created_at":"2015-09-08T22:24:29.000Z","updated_at":"2024-10-08T23:29:45.000Z","dependencies_parsed_at":"2024-01-29T10:10:00.009Z","dependency_job_id":"bdd6af9e-4711-4c75-93a4-1ab085b9c680","html_url":"https://github.com/ajv-validator/ajv-i18n","commit_stats":{"total_commits":298,"total_committers":48,"mean_commits":6.208333333333333,"dds":0.6442953020134228,"last_synced_commit":"866e21752b9531c39d4a24e6fe15cc17f94b7f75"},"previous_names":["epoberezkin/ajv-i18n"],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajv-validator%2Fajv-i18n","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajv-validator%2Fajv-i18n/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajv-validator%2Fajv-i18n/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajv-validator%2Fajv-i18n/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ajv-validator","download_url":"https://codeload.github.com/ajv-validator/ajv-i18n/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247358209,"owners_count":20926178,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ajv","i18n","internationalization","json-schema","validator"],"created_at":"2024-09-26T16:22:58.788Z","updated_at":"2025-04-06T17:11:57.891Z","avatar_url":"https://github.com/ajv-validator.png","language":"JavaScript","funding_links":["https://github.com/sponsors/epoberezkin","https://tidelift.com/funding/github/npm/ajv-i18n","https://tidelift.com/subscription/pkg/npm-ajv-i18n?utm_source=npm-ajv-i18n\u0026utm_medium=referral\u0026utm_campaign=enterprise\u0026utm_term=repo","https://tidelift.com/security"],"categories":[],"sub_categories":[],"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\u003csup\u003e1\u003c/sup\u003e|draft-07\u003csup\u003e2\u003c/sup\u003e|draft\u003cbr\u003e2019-09\u003csup\u003e3\u003c/sup\u003e\u003cbr\u003e/2020-12\u003csup\u003e4\u003c/sup\u003e|JTD\u003csup\u003e5\u003c/sup\u003e\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)\u003cbr\u003e[NAM0007](https://github.com/NAM0007)|✓\u003cbr\u003e\u0026nbsp;|✓\u003cbr\u003e\u0026nbsp;|\u003cbr\u003e✓|-|*|\n|🇩🇪 de|German   |[jmtoball](https://github.com/jmtoball)\u003cbr\u003e[gflohr](https://github.com/gflohr)|✓\u003cbr\u003e\u0026nbsp;|✓\u003cbr\u003e\u0026nbsp;|\u003cbr\u003e✓|✓\u003cbr\u003e\u0026nbsp;|✓\u003cbr\u003e\u0026nbsp;|\n|🇪🇸 es|Spanish  |[jpablom](https://github.com/jpablom)|✓|✓|✓|-|*|\n|🇫🇮 fi|Finnish  |[saulipurhonen](https://github.com/saulipurhonen)|✓|✓|✓|✓|✓|\n|🇫🇷 fr|French   |[monlouisj](https://github.com/monlouisj)\u003cbr\u003e[Telokis](https://github.com/Telokis)|✓\u003cbr\u003e\u0026nbsp;|✓\u003cbr\u003e\u0026nbsp;|\u003cbr\u003e✓|-|*|\n|🇭🇺 hu|Hungarian|[szilveszter9](https://github.com/szilveszter9)|✓|-|-|-|*|\n|🇮🇩 id|Indonesian|[ekoeryanto](https://github.com/ekoeryanto)|✓|✓|✓|-|*|\n|🇮🇹 it|Italian  |[jasoniangreen](https://github.com/jasoniangreen)\u003cbr\u003e[lucacorti](https://github.com/lucacorti)|✓\u003cbr\u003e\u0026nbsp;|\u003cbr\u003e✓|\u003cbr\u003e✓|\u003cbr\u003e✓|\u003cbr\u003e✓|\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)\u003cbr\u003e[niekvb](https://github.com/niekvb)|✓|✓|✓|\u003cbr\u003e✓|\u003cbr\u003e✓|\n|🇵🇱 pl|Polish   |[danielzurawski](https://github.com/danielzurawski)|✓|-|-|-|*|\n|🇧🇷 pt-BR|Português - Brasil|[marcosrava](https://github.com/marcosrava)\u003cbr\u003e[ggondim](https://github.com/ggondim)|✓|✓|✓|\u003cbr\u003e✓|\u003cbr\u003e✓|\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)\u003cbr\u003e[leuction](https://github.com/leuction)|✓\u003cbr\u003e\u0026nbsp;|\u003cbr\u003e✓|\u003cbr\u003e✓|\u003cbr\u003e✓|\u003cbr\u003e✓|\n|🇹🇼 zh-TW|Chinese - Taiwan|[minipai](https://github.com/minipai)|✓|✓|✓|✓|✓|\n\n\n\u003csup\u003e1\u003c/sup\u003e added boolean schema, keywords `const`, `contains`, `propertyNames`\n\n\u003csup\u003e2\u003c/sup\u003e added keywords `if`/`then`/`else`\n\n\u003csup\u003e3\u003c/sup\u003e added messages for keywords `unevaluatedProperties`, `unevaluatedItems`, `dependentRequired`\n\n\u003csup\u003e4\u003c/sup\u003e keyword `items` messages\n\n\u003csup\u003e5\u003c/sup\u003e 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 \u003e= 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\u0026s=40)](https://github.com/danielzurawski \"danielzurawski\")\n[![szilveszter9](https://avatars0.githubusercontent.com/u/7540866?v=3\u0026s=40)](https://github.com/szilveszter9 \"szilveszter9\")\n[![jmtoball](https://avatars0.githubusercontent.com/u/219950?v=3\u0026s=40)](https://github.com/jmtoball \"jmtoball\")\n[![gilgongo](https://avatars2.githubusercontent.com/u/4561747?v=3\u0026s=40)](https://github.com/gilgongo \"gilgongo\")\n[![jasoniangreen](https://avatars3.githubusercontent.com/u/3481367?v=3\u0026s=40)](https://github.com/jasoniangreen \"jasoniangreen\")\n[![jpablom](https://avatars0.githubusercontent.com/u/3935083?v=3\u0026s=40)](https://github.com/jpablom \"jpablom\")\n[![limmen](https://avatars2.githubusercontent.com/u/8254791?v=3\u0026s=40)](https://github.com/Limmen \"Limmen\")\n[![jinzhubaofu](https://avatars2.githubusercontent.com/u/811195?v=3\u0026s=40)](https://github.com/jinzhubaofu \"jinzhubaofu\")\n[![kiskovacs](https://avatars1.githubusercontent.com/u/2733311?v=3\u0026s=40)](https://github.com/kiskovacs \"kiskovacs\")\n[![mahmoud-mardeni](https://avatars2.githubusercontent.com/u/19661270?s=40\u0026v=3)](https://github.com/Mahmoud-Mardeni \"mahmoud-mardeni\")\n[![monlouisj](https://avatars0.githubusercontent.com/u/5998380?v=3\u0026s=40)](https://github.com/monlouisj \"monlouisj\")\n[![marcosrava](https://avatars2.githubusercontent.com/u/243790?v=3\u0026s=40)](https://github.com/marcosrava \"marcosrava\")\n[![mtramm](https://avatars3.githubusercontent.com/u/3519541?v=3\u0026s=40)](https://github.com/mtramm \"mtramm\")\n[![Mahmoud-Mardeni](https://avatars3.githubusercontent.com/u/19661270?v=3\u0026s=40)](https://github.com/Mahmoud-Mardeni \"Mahmoud-Mardeni\")\n[![leuction](https://avatars3.githubusercontent.com/u/8056270?v=3\u0026s=40)](https://github.com/leuction \"leuction\")\n[![lucacorti](https://avatars2.githubusercontent.com/u/1076999?v=3\u0026s=40)](https://github.com/lucacorti \"lucacorti\")\n[![minipai](https://avatars2.githubusercontent.com/u/239570?s=40\u0026v=4)](https://github.com/minipai \"minipai\")\n[![encX](https://avatars3.githubusercontent.com/u/5965883?v=3\u0026s=40)](https://github.com/encX \"encX\")\n[\u003cimg src=\"https://avatars3.githubusercontent.com/u/1067403?s=40\u0026v=4\" alt=\"pimlie\" width=\"40px\"/\u003e](https://github.com/pimlie \"pimlie\")\n[![MinByeongDon](https://avatars2.githubusercontent.com/u/6141807?s=40\u0026v=4)](https://github.com/MinByeongDon \"MinByeongDon\")\n[![gflohr](https://avatars0.githubusercontent.com/u/7126580?s=40\u0026v=4)](https://github.com/gflohr \"gflohr\")\n[![ekoeryanto](https://avatars2.githubusercontent.com/u/36023898?s=40\u0026v=4)](https://github.com/ekoeryanto \"ekoeryanto\")\n[![Telokis](https://avatars3.githubusercontent.com/u/6382729?s=40\u0026v=4)](https://github.com/Telokis \"Telokis\")\n[\u003cimg src=\"https://avatars3.githubusercontent.com/u/15526814?s=40\u0026v=4\" alt=\"alexandreec\" width=\"40px\"\u003e](https://github.com/alexandreec \"alexandreec\")\n[![ggondim](https://avatars2.githubusercontent.com/u/2074685?s=40\u0026v=4)](https://github.com/ggondim \"ggondim\")\n[![niekvb](https://avatars3.githubusercontent.com/u/37668320?s=40\u0026v=4)](https://github.com/niekvb \"niekvb\")\n[![NAM0007](https://avatars1.githubusercontent.com/u/47188486?s=40\u0026v=4)](https://github.com/NAM0007 \"NAM0007\")\n[![saulipurhonen](https://avatars.githubusercontent.com/u/48789543?s=40\u0026v=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\u0026utm_medium=referral\u0026utm_campaign=enterprise\u0026utm_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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajv-validator%2Fajv-i18n","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fajv-validator%2Fajv-i18n","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajv-validator%2Fajv-i18n/lists"}