GlobalsBuilder

A builder class for creating a GlobalConfig object.

This class provides methods for setting various properties of a global configuration, such as the global parameters, the global prefix, and the global suffix. It also provides methods for adding global parameters using different formats, such as a map, a pair, or a custom initializer. The build method returns a new GlobalConfig object based on the current state of the builder.

Author

TOTHTOMI

Since

Jul. 25, 2023

Constructors

Link copied to clipboard
constructor()

Creates a new GlobalsBuilder with empty values for all properties.

Functions

Link copied to clipboard

Builds and returns a new GlobalConfig object based on the current state of the builder.

Link copied to clipboard
fun globalParameter(key: String, value: String)

Adds a single global parameters to the builder. Global parameters will be provided to every translation's script parser at runtime.

Link copied to clipboard
fun globalParameters(initializer: GlobalParameter.() -> Unit)

Adds multiple global parameters to the builder using a custom initializer, so you can use it via DSL. Global parameters will be provided to every translation's script parser at runtime.

Adds multiple global parameters to the builder. Global parameters will be provided to every translation's script parser at runtime.

Link copied to clipboard
fun prefix(prefix: String)

Sets the global prefix. A global prefix will be applied to the start of every translation at runtime

Link copied to clipboard
fun suffix(suffix: String)

Sets the global suffix. A global suffix will be applied to the end of every translation at runtime