getMessage

abstract fun getMessage(key: MessageKey<*, *>, vararg args: Any): C

Retrieves a formatted localized message based on the provided key and optional arguments.

The formatting follows a sequential argument replacement mechanism (e.g., %s, %s).

Return

The formatted localized message content.

Parameters

key

The message key.

args

Optional arguments used to format the message.


abstract fun <K, V> getMessage(key: MessageKey<*, *>, argsComplete: Map<K, V>): C

Retrieves a formatted localized message using a map of named arguments.

This method allows for explicit placeholder replacement (e.g., %player%, %id%).

Return

The formatted localized message content.

Parameters

key

The message key.

argsComplete

A map of placeholders and their corresponding values.


abstract fun <T, K, V> getMessage(key: MessageKey<*, *>, intermediate: T, transform: (T) -> Map<K, V>): C

Retrieves a formatted localized message using an intermediate data type.

The given intermediate object is transformed into a placeholder map, which is then used for message formatting.

Return

The formatted localized message content.

Parameters

key

The message key.

intermediate

An object containing data relevant to the message.

transform

A function to convert the intermediate object into a map of placeholders.