This PR adds a --minify flag anywhere we're outputting JSON, and absent that - by default - outputs prettified JSON.
The formatting logic is mostly copied from the prettify module (which prettifies ICU for intlc prettify). As there prettified output uses tabs for indentation.
Example:
$ cat x.json
{
"x": { "message": "Hello {name}" },
"y": { "message": "Today is a {day, select, Friday {glorious} other {fine}} day." },
}
$ intlc flatten x.json
{
"x": {
"message": "Hello {name}",
"backend": "ts",
"description": null
},
"y": {
"message": "{day, select, Friday {Today is a glorious day.} other {Today is a fine day.}}",
"backend": "ts",
"description": null
}
}
$ intlc flatten x.json --minify
{"x":{"message":"Hello {name}","backend":"ts","description":null},"y":{"message":"{day, select, Friday {Today is a glorious day.} other {Today is a fine day.}}","backend":"ts","description":null}}
This PR adds a
--minify
flag anywhere we're outputting JSON, and absent that - by default - outputs prettified JSON.The formatting logic is mostly copied from the prettify module (which prettifies ICU for
intlc prettify
). As there prettified output uses tabs for indentation.Example:
Closes #47.