The parse(src, [options]) function takes two parameters, first the
string to be parsed, and a second optional parameter options, an object with
the following possible keys:
cardinal and ordinal – Arrays of valid plural categories for the current
locale, used to validate plural and selectordinal keys. If these are
missing or set to false, the full set of valid Unicode CLDR keys is used:
'zero', 'one', 'two', 'few', 'many', 'other'. To disable this check, pass in
an empty array.
strict – By default, the parsing applies a few relaxations to the ICU
MessageFormat spec. Setting strict: true will disable these relaxations:
The argType of simpleArg formatting functions will be restricted to the
set of number, date, time, spellout, ordinal, and duration,
rather than accepting any lower-case identifier that does not start with a
number.
The optional argStyle of simpleArg formatting functions will not be
parsed as any other text, but instead as the spec requires: "In
argStyleText, every single ASCII apostrophe begins and ends quoted literal
text, and unquoted {curly braces} must occur in matched pairs."
Inside a plural or selectordinal statement, a pound symbol (#) is
replaced with the input number. By default, # is also parsed as a special
character in nested statements too, and can be escaped using apostrophes
('#'). In strict mode # will be parsed as a special character only
directly inside a plural or selectordinal statement. Outside those, #
and '#' will be parsed as literal text.
The parser only supports the default DOUBLE_OPTIONALapostrophe mode, in
which a single apostrophe only starts quoted literal text if it immediately
precedes a curly brace {}, or a pound symbol # if inside a plural format. A
literal apostrophe ' is represented by either a single ' or a doubled ''
apostrophe character.