mf1ToMessage() function

This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Compile an ICU MessageFormat 1 message into a MessageFormat instance.

A runtime provided by getMF1Functions() is automatically used in these instances.

Signature:

export declare function mf1ToMessage(source: string | Token[] | Message, locales?: string | string[], { strict, ...opt }?: MF1Options & MessageFormatOptions): MessageFormat;

Parameters

Parameter Type Description
source string | Token[] | Message An ICU MessageFormat message, either in its syntax representation, as an array of @messageformat/parser AST tokens, or as a Message data structure.
locales string | string[] (Optional) The locale to use for the message.
{ strict, …opt } MF1Options & MessageFormatOptions (Optional)

Returns:

MessageFormat