Gathering detailed insights and metrics for ajv-i18n
Gathering detailed insights and metrics for ajv-i18n
Gathering detailed insights and metrics for ajv-i18n
Gathering detailed insights and metrics for ajv-i18n
Internationalised error messages for Ajv JSON schema validator
npm install ajv-i18n
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
171 Stars
414 Commits
90 Forks
5 Watching
5 Branches
35 Contributors
Updated on 08 Oct 2024
Minified
Minified + Gzipped
JavaScript (97.16%)
EJS (2.61%)
Shell (0.23%)
Cumulative downloads
Total Downloads
Last day
-2.1%
28,040
Compared to previous day
Last week
3.5%
142,297
Compared to previous week
Last month
14.1%
590,531
Compared to previous month
Last year
2.8%
5,985,333
Compared to previous year
1
Internationalised error messages for Ajv - superfast JSON validator for JSON Schema and JSON Type Definition.
locale | language | contributor | draft-04 | draft-061 | draft-072 | draft 2019-093 /2020-124 | JTD5 |
---|---|---|---|---|---|---|---|
🇬🇧 en | English | ✓ | ✓ | ✓ | ✓ | ✓ | |
AR ar | Arabic | Mahmoud-Mardeni | ✓ | ✓ | ✓ | - | - |
CA ca | Catalan | alexandreec | ✓ | ✓ | ✓ | - | * |
🇨🇿 cs | Czech | kiskovacs NAM0007 | ✓  | ✓  | ✓ | - | * |
🇩🇪 de | German | jmtoball gflohr | ✓  | ✓  | ✓ | ✓  | ✓  |
🇪🇸 es | Spanish | jpablom | ✓ | ✓ | ✓ | - | * |
🇫🇮 fi | Finnish | saulipurhonen | ✓ | ✓ | ✓ | ✓ | ✓ |
🇫🇷 fr | French | monlouisj Telokis | ✓  | ✓  | ✓ | - | * |
ðŸ‡ðŸ‡º hu | Hungarian | szilveszter9 | ✓ | - | - | - | * |
🇮🇩 id | Indonesian | ekoeryanto | ✓ | ✓ | ✓ | - | * |
🇮🇹 it | Italian | jasoniangreen lucacorti | ✓  | ✓ | ✓ | ✓ | ✓ |
🇯🇵 ja | Japanese | gilgongo | ✓ | - | - | - | * |
🇰🇷 ko | Korean | MinByeongDon | ✓ | ✓ | ✓ | ✓ | ✓ |
🇳🇴 nb | Norwegian bokmål | mtramm | ✓ | ✓ | - | - | * |
🇳🇱 nl | Dutch | pimlie niekvb | ✓ | ✓ | ✓ | ✓ | ✓ |
🇵🇱 pl | Polish | danielzurawski | ✓ | - | - | - | * |
🇧🇷 pt-BR | Português - Brasil | marcosrava ggondim | ✓ | ✓ | ✓ | ✓ | ✓ |
🇷🇺 ru | Russian | ✓ | ✓ | ✓ | ✓ | ✓ | |
🇸🇰 sk | Slovak | kiskovacs | ✓ | ✓ | - | - | * |
🇸🇪 sv | Swedish | limmen | ✓ | ✓ | - | - | * |
🇹🇠th | Thai | encX | ✓ | ✓ | ✓ | ✓ | ✓ |
🇨🇳 zh | Chinese | jinzhubaofu leuction | ✓  | ✓ | ✓ | ✓ | ✓ |
🇹🇼 zh-TW | Chinese - Taiwan | minipai | ✓ | ✓ | ✓ | ✓ | ✓ |
1 added boolean schema, keywords const
, contains
, propertyNames
2 added keywords if
/then
/else
3 added messages for keywords unevaluatedProperties
, unevaluatedItems
, dependentRequired
4 keyword items
messages
5 JSON Type Definition
* discriminator
form messages are not translated
Please contribute locales that you need to use if they are missing or incomplete.
Using npm:
npm install ajv-i18n
In node:
1const Ajv = require("ajv") // version >= 8.0.0 2const localize = require("ajv-i18n") 3// or for JSON Type Definition 4// const localize = require("ajv-i18n/localize/jtd") 5 6const ajv = Ajv({allErrors: true, messages: false}) 7const validate = ajv.compile(schema) 8const valid = validate(data) 9 10if (!valid) { 11 // ru for Russian 12 localize.ru(validate.errors) 13 // string with all errors and data paths 14 console.log(ajv.errorsText(validate.errors, {separator: '\n'})) 15}
To require only necessary locales (e.g., with browserify):
1const localize_ru = require('ajv-i18n/localize/ru') 2// or for JSON Type Definition 3// const localize_ru = require('ajv-i18n/localize/ru/jtd')
or
1const localize = { 2 en: require('ajv-i18n/localize/en'), 3 ru: require('ajv-i18n/localize/ru'), 4}
See Ajv docs for more information.
npm install
git submodule update --init
npm test
Functions that localize error messages are generated using doT template localize.jst, JSON Schema messages and JSON Type Definition messages. Templates are pre-compiled, so doT is not a run-time dependency.
npm run build
- compiles functions to localize folder.
ajv-i18n package is a part of Tidelift enterprise subscription - it provides a centralised commercial support to open-source software users, in addition to the support provided by software maintainers.
To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerability via GitHub issues.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 4/10 approved changesets -- score normalized to 4
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More