The main localizer for this guild localizer.
The guild that corresponds to this guild localizer.
Readonly
dataThe key to be used to save the guild's locale in the client's data provider.
locale
GuildLocalizer
Readonly
guildThe guild that corresponds to this guild localizer.
GuildLocalizer
The current locale set for the guild. Do not update this value manually, instead use
the updateLocale()
method.
GuildLocalizer
Readonly
localizerThe main localizer for this guild localizer.
GuildLocalizer
Initializes this guild localizer. You should call this after initializing the client's data provider since this method will read the locale set for each guild and will initialize their localizer with that value.
A promise that resolves to the locale set for this guild localizer.
Rejects if a guild localizer was being initialized with an unsupported locale retrieved from the data provider. This may happen if the locale saved in the data provider was updated manually.
Alias for translate()
.
The key of the message to translate.
The dynamic values to be replaced in the message.
The translated message.
Throws if the key does not resolve to any message.
Throws if the given locale is not supported.
Get the message for the given key translated into the locale of this guild localizer. You can also supply an object containing the dynamic values to be used.
The key of the message to translate.
The dynamic values to be replaced in the message.
The translated message.
Throws if the key does not resolve to any message.
Throws if the given locale is not supported.
Updates the locale set to this guild localizer. If the client has a data provider, it will also update the locale in it for persistence.
The new locale to be used by this guild localizer.
A promise that resolves once the locale has been updated.
Rejects if the given locale is not supported.
Generated using TypeDoc
A class to help with localization of your bot. This handles string translation from the context of the guild. For more information, check Localizer.