Translation

data class Translation(val id: String, val defaultValue: String, val group: String = "common", val language: String = "en", val mainColor: String? = null, val colors: Array<String> = emptyArray(), val autoRegister: Boolean = true)

Representation of a translation.

Parameters

id

The id of the translation

defaultValue

The default value of the translation.

group

The group (folder) of the translation. Defaults to "common"

language

The language of the translation. (Defaults to "en")

mainColor

The main color of the translation. (Defaults to null)

colors

The colors to use in the translation replacing strings. Example (using color '&c'): 'test' should return '&ctest'. Defaults to empty array.

autoRegister

If the translation should be automatically registered. (Defaults to true) It is recommended to disable if you're going to initialize the same translation multiple times (for example inside a loop)

Constructors

Link copied to clipboard
constructor(id: String, defaultValue: String, group: String = "common", language: String = "en", mainColor: String? = null, colors: Array<String> = emptyArray(), autoRegister: Boolean = true)

Properties

Link copied to clipboard
val autoRegister: Boolean = true
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val id: String
Link copied to clipboard
Link copied to clipboard
val mainColor: String? = null

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun translate(language: String? = null, placeholders: Map<String, String> = emptyMap(), colorize: Boolean = true): String

Translates this Translation to the current language.