Skip to content

Commit

Permalink
Add formatting to README
Browse files Browse the repository at this point in the history
  • Loading branch information
samhh committed Oct 24, 2022
1 parent 1455ac1 commit fbf22ad
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,27 @@ welcome:
Redundant select: name
```

### Formatting

Pretty-print an ICU message. Useful for inspecting larger messages, such as flattened ones.

```console
$ cat translations.json
{"tagline": {"message":"{hasTags, boolean, true {{type, select, overLimit {{upperLimit, number}+ best free {formattedListOfTags} photos on Unsplash} belowLimit {{photoTotal, number} best free {formattedListOfTags} photos on Unsplash}}} false {{type, select, overLimit {{upperLimit, number}+ best free photos on Unsplash} belowLimit {{photoTotal, number} best free photos on Unsplash}}}}"}}
$ intlc prettify $(cat translations.json | jq -r .tagline.message)
{hasTags, boolean,
true {{type, select,
overLimit {{upperLimit, number}+ best free {formattedListOfTags} photos on Unsplash}
belowLimit {{photoTotal, number} best free {formattedListOfTags} photos on Unsplash}
}}
false {{type, select,
overLimit {{upperLimit, number}+ best free photos on Unsplash}
belowLimit {{photoTotal, number} best free photos on Unsplash}
}}
}

```

## Schema

Translation files should be encoded as JSON and might look something like this:
Expand Down

0 comments on commit fbf22ad

Please sign in to comment.