
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
messageformat-validator
Advanced tools
Validates that ICU MessageFormat strings are well-formed, and that translated target strings are compatible with their source.
Validates messageformat messages against various errors and warnings.
npm i messageformat-validator
mfv [options] [subcommand]
Check for issues in all files within lang/
mfv -s en -p lang/
Add messages that exist in en
to all files within lang/
, if they are missing
mfv -s en -p lang/ add-missing
Output the myMessage
message from the es-es
file with all messageformat structure highlighted
mfv -l es-es -p lang/ highlight myMessage
-V, --version
- output the version number
-e, --throw-errors
- Throw an error if error issues are found
--no-issues
- Don't output issues
-i, --ignoreIssueTypes <items>
- Ignore these comma-separated issue types
-l, --locales <items>
- Process only these comma-separated locales
-p, --path <path>
- Path to a directory containing locale files
-t, --translator-output
- Output JSON of all source messages that are missing or untranslated in the target
-s, --source-locale <locale>
- The locale to use as the source
--json-obj
- Indicate that the files to be parsed are JSON files with keys that have objects for values with their own keys: translation
and context
-h, --help
- display help for command
remove-extraneous
- Remove messages that do not exist in the source locale
add-missing
- Add messages that do not exist in the target locale
sort
- Sort messages alphabetically by key, maintaining any blocks
rename <old-key> <new-key>
- Rename a message
highlight <key>
- Output a message with all non-translatable ICU MessageFormat structure highlighted
help [command]
- display help for command
Some options can be configured with default values in mfv.config.json
{
"source": "en"
"path": "lang/",
"locales": "ar,de,en,es,es-es,hi,tr",
"jsonObj": true
}
argument
- There are unrecognized arguments in the target message.
brace
- There are mismatched braces in the target message.
case
- There are unrecognized cases in the target message.
extraneous
- There is an extraneous message in the target locale.
missing
- There is a message missing from the target locale.
nbsp
- There are invalid non-breaking spaces in the structure of the target message.
nest
- The nesting order of the target message does not match the source message.
other
- The target message is missing an other
case
parse
- The target message can not be parsed.
source
- There is an error in the source message.
categories
- The target message is missing plural categories used in the target locale
nest
- There is a select
nested inside a plural
or selectordinal
in the target message.
split
- The target message is split by a non-argument. plural
, selectordinal
, and select
cases should contain complete translations.
untranslated
- The target message has not been translated.
FAQs
Validates that ICU MessageFormat strings are well-formed, and that translated target strings are compatible with their source.
The npm package messageformat-validator receives a total of 3,807 weekly downloads. As such, messageformat-validator popularity was classified as popular.
We found that messageformat-validator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.