LocalizableAction

Allows you to configure the localization settings of this interaction/command, as well as retrieve a localization context from it.

Configuring localization bundle and prefix

You can change the bundle and prefix in the first lines of your interaction handler, with localizationBundle and localizationPrefix.

See also

Inheritors

Properties

Link copied to clipboard
abstract var localizationBundle: String?

If set, forces the specified localization bundle to be used.

Link copied to clipboard
abstract var localizationPrefix: String?

If set, adds the specified prefix to the path of every localization call, useful to avoid using very long strings in every reply/edit.

Functions

Link copied to clipboard

Retrieves a DefaultMessages instance, using a locale suitable for messages sent to the user.

Link copied to clipboard
abstract fun getLocalizationContext(bundleName: String, pathPrefix: String?): LocalizationContext

Returns a localization context for the provided bundle name and path prefix.

Link copied to clipboard
abstract fun getLocalizedMessage(locale: Locale, localizationPath: String, vararg entries: Localization.Entry): String
open fun getLocalizedMessage(locale: DiscordLocale, localizationPath: String, vararg entries: Localization.Entry): String

Returns the localized message at the following path, using the provided locale and parameters.

Link copied to clipboard
fun LocalizableAction.getLocalizedMessage(locale: Locale, localizationPath: String, vararg entries: PairEntry): String
fun LocalizableAction.getLocalizedMessage(locale: DiscordLocale, localizationPath: String, vararg entries: PairEntry): String