Localization

object Localization

Handles localization of strings using java ResourceBundles.

Message property files should reside in src/main/resources named messages_locale.properties, where locale is formatted as returned by Locale.toString.

Functions

get
Link copied to clipboard
fun get(locale: Locale, key: String): String
Returns the localized string for key
fun get(locale: Locale, key: String, vararg args: Pair<String, Any?>): String
Additionally formats the localized string with the named args, which are represented as {argumentName} in the translations

Properties

localeProvider
Link copied to clipboard
var localeProvider: (Player) -> Locale
This function determines which locale is used for a player, by default Locale.US is always returned.