translate

fun translate(locale: Locale, key: String, vararg args: Any): String?

Translates a message key for the specified locale.

Falls back to the default locale if the key is not found. Supports MessageFormat-style placeholders (e.g., {0}, {1}).

Return

The translated message, or null if the key is not found

Parameters

locale

The target locale

key

The translation key

args

Optional arguments for placeholder substitution


fun translate(player: Player, key: String, vararg args: Any): String?

Translates a message key using the player's locale.

Return

The translated message, or null if the key is not found

Parameters

player

The player whose locale will be used

key

The translation key

args

Optional arguments for placeholder substitution