MessageFormatOptions interface

Options for the MessageFormat constructor


export interface MessageFormatOptions<ReturnType extends 'string' | 'values' = 'string' | 'values'> 


Property Modifiers Type Description
biDiSupport?   boolean <p>(Optional) Add Unicode control characters to all input parts to preserve the integrity of the output when mixing LTR and RTL text</p><p>Default: false</p>
currency?   string <p>(Optional) The currency to use when formatting {V, number, currency}</p><p>Default: USD</p>
customFormatters?   { [key: string]: CustomFormatter | { formatter: CustomFormatter; arg?: ‘string’ | ‘raw’ | ‘options’; id?: string; module?: string; }; } (Optional) Map of custom formatting functions to include. See Custom Formatters for more details.
localeCodeFromKey?   ((key: string) => string | null | undefined) | null <p>(Optional) If defined, used by compileModule() to identify and map keys to the locale identifiers used by formatters and plural rules. The values returned by the function should match the locale argument.</p><p>Default: undefined</p>
requireAllArguments?   boolean <p>(Optional) Require all message arguments to be set with a defined value</p><p>Default: false</p>
returnType?   ReturnType <p>(Optional) Return type of compiled functions; either a concatenated 'string' or an array (possibly hierarchical) of 'values'.</p><p>Default: 'string'</p>
strict?   boolean <p>(Optional) Follow the ICU MessageFormat spec more closely, but not allowing custom formatters and by allowing# only directly within a plural or selectordinal case, rather than in any inner select case as well. See the parser option for more details.</p><p>Default: false</p>
strictPluralKeys?   boolean <p>(Optional) Enable strict checks for plural keys according to Unicode CLDR. When set to false, the compiler will also accept any invalid plural keys. Also see the corresponding parser option.</p><p>Default: true</p>