Skip to content

Localization provider interface

LocalizationProviderInterface #

Bases: Protocol

Localization provider interface.

It's used to localize commands, components, and provide a locale for interaction. To create your own implementation, you need to inherit from this interface.

build_localized #
build_localized(value: Localized) -> None

Build Localized object for Discord API.

Warning

This function must change Localized object.

The new value should include translations for the localized object and any new fallback. With the fallback, you can either use the first translation, translation with your default language, or take no action if there's a fallback.

get_locale #

Get locale by name or interaction.

start async #
start() -> None

Start the localization provider.