Text Localization Context
Interface helping in localizing content, supports preset localization bundles, localization prefixes, and context-aware localization.
Guild locale
The guild locale is set by GuildLocaleProvider (by default Guild.getLocale).
You can implement your own locale provider to change the locale used by this localization context.
Manual usage
While instances of this interface are primarily injected with @LocalizationBundle, you can also construct instances of this interface with LocalizationContext.create.
Instances are only injectable if the event is a subclass of either Interaction or MessageReceivedEvent.
See also
Inheritors
Properties
The locale used when no locale is specified, the best locale is picked in this order:
Returns the DiscordLocale of the guild.
Returns the localization bundle of the current context.
Returns the localization prefix of the current context.
Functions
Whether this localization context has a Guild locale.
Localizes the provided path, with the best locale available.
Localizes the provided path, with the provided locale.
Localizes the provided path, with the best locale available.
Localizes the provided path, with the provided locale.
Localizes the provided path, with the guild's locale.
Localizes the provided path, with the guild's locale.
Localizes the provided path, with the guild's locale, or returns null
if the path does not exist.
Localizes the provided path, with the guild's locale, or returns null
if the path does not exist.
Localizes the provided path, with the best locale available, or returns null
if the path does not exist.
Localizes the provided path, with the provided locale, or returns null
if the path does not exist.
Localizes the provided path, with the best locale available, or returns null
if the path does not exist.
Localizes the provided path, with the provided locale, or returns null
if the path does not exist.
Returns a new localization context with the specified localization bundle, and resets the localization prefix.
Returns a new localization context with the specified localization bundle.
Returns a new TextLocalizationContext with the specified guild locale.
Returns a new localization context with the specified localization prefix.
Returns a new AppLocalizationContext with the specified user locale.