2.6.5 • Published 27 days ago

messageformat-validator v2.6.5

Weekly downloads
92
License
MIT
Repository
github
Last release
27 days ago

messageformat-validator

Validates messageformat messages against various errors and warnings.

Install

npm i messageformat-validator

Usage

mfv [options] [subcommand]

Examples

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

Options:

-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

Subommands:

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

Config File

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
}

Errors

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.

Warnings

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.

2.6.5

27 days ago

2.6.3

30 days ago

2.6.4

29 days ago

2.6.1

1 month ago

2.6.0

1 month ago

2.6.2

1 month ago

2.5.0

5 months ago

2.4.2

1 year ago

2.3.0

2 years ago

2.2.1

2 years ago

2.2.0

2 years ago

2.4.1

2 years ago

2.3.2

2 years ago

2.4.0

2 years ago

2.3.1

2 years ago

2.2.2

2 years ago

2.0.3

2 years ago

2.1.1

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.7

2 years ago

2.0.6

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.0

4 years ago

0.3.0

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.22

6 years ago

0.0.21

6 years ago

0.0.20

6 years ago

0.0.19

6 years ago

0.0.18

6 years ago

0.0.17

6 years ago

0.0.16

6 years ago

0.0.15

6 years ago

0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago