messageformat package

Classes

Class Description
MessageDataModelError (BETA) Errors in the message data model.
MessageError (BETA) Base error class used by MessageFormat
MessageFormat (BETA) Create a new message formatter.
MessageResolutionError (BETA) Message runtime resolution errors
MessageSelectionError (BETA) Errors in message selection.
MessageSyntaxError (BETA) Errors in the message syntax.

Functions

Function Description
messageFromCST(msg) (BETA) Convert a CST message structure into its data model representation.
parseCST(source, opt) (BETA) Parse the string syntax representation of a message into its corresponding CST representation.
stringifyCST(cst) (BETA) Stringify a message CST. Does not perform any error checking or validation.
stringifyMessage(msg) (BETA) Stringify a message using its syntax representation.
validate(msg, onError) (BETA) Ensure that the msg data model is _valid_, calling onError on errors.
visit(msg, visitors) (BETA) Apply visitor functions to message nodes.

Interfaces

Interface Description
CatchallKey (BETA) The catch-all key matches all values.
FunctionAnnotation (BETA) To resolve a FunctionAnnotation, an externally defined function is called.
InputDeclaration (BETA)
Literal (BETA) An immediately defined value.
LocalDeclaration (BETA)
MarkupClose (BETA)
MarkupOpen (BETA)
MarkupStandalone (BETA)
MessageDateTimePart (BETA)
MessageExpressionPart (BETA)
MessageFallbackPart (BETA)
MessageFormatOptions (BETA)
MessageFunctions (BETA) The runtime function registry available when resolving FunctionAnnotation elements.
MessageLiteralPart (BETA)
MessageMarkupClosePart (BETA)
MessageMarkupPart (BETA)
MessageNumberPart (BETA)
MessageStringPart (BETA)
MessageUnknownPart (BETA)
Option (BETA) The options of FunctionAnnotation and Markup are expressed as key/value pairs to allow their order to be maintained.
Pattern (BETA) The body of each message is composed of a sequence of parts, some of them fixed (Text), others placeholders for values depending on additional data.
PatternMessage (BETA) A single message with no variants.
SelectMessage (BETA) SelectMessage generalises the plural, selectordinal and select argument types of MessageFormat 1. Each case is defined by a key of one or more string identifiers, and selection between them is made according to the values of a corresponding number of expressions. Selection iterates among the variants in order, and terminates when all of the Variant keys match. The result of the selection is always a single Pattern.
UnsupportedAnnotation (BETA) When the parser encounters an expression with reserved syntax, it emits an UnsupportedAnnotation to represent it.
UnsupportedStatement (BETA)
VariableRef (BETA) The value of a VariableRef is defined by the current Scope.
Variant (BETA)

Namespaces

Namespace Description
CST  

Variables

Variable Description
cst (BETA) Shared symbol used as a key on message data model nodes to reference their CST source.
isCatchallKey (BETA)
isExpression (BETA)
isFunctionAnnotation (BETA)
isLiteral (BETA)
isMarkup (BETA)
isMessage (BETA)
isPatternMessage (BETA)
isSelectMessage (BETA)
isUnsupportedAnnotation (BETA)
isVariableRef (BETA)

Type Aliases

Type Alias Description
Declaration (BETA) A message may declare any number of input and local variables, each with a value defined by an expression. The variable name for each declaration must be unique.
Expression (BETA) Expressions are used in declarations, as selectors, and as placeholders. Each must include at least an arg or an annotation, or both.
Markup (BETA) Markup placeholders can span ranges of other pattern elements, or represent other inline elements.
Message (BETA) The representation of a single message. The shape of the message is an implementation detail, and may vary for the same message in different languages.
MessageNode (BETA) A node in a message data model
MessagePart (BETA)