Messages.addMessages() method

Add new messages to the accessor; useful if loading data dynamically

Signature:

addMessages(data: MessageData | MessageFunction, locale?: string, keypath?: string[]): this;

Parameters

Parameter Type Description
data MessageData | MessageFunction Hierarchical map of keys to functions, or a single message function
locale string (Optional) If empty or undefined, defaults to this.locale
keypath string[] (Optional) The keypath being added

Returns:

this

Remarks

The locale code lc should be an exact match for the locale being updated, or empty to default to the current locale. Use Messages.resolveLocale() for resolving partial locale strings.

If keypath is empty, adds or sets the complete message object for the corresponding locale. If any keys in keypath do not exist, a new object will be created at that key.