@sapphire/plugin-i18next
Classes
Class | Description |
---|---|
InternationalizationHandler | A generalized class for handling i18next JSON files and their discovery. |
Interfaces
Interface | Description |
---|---|
$Dictionary | This is a re-exported type from i18next. It is essentially an object of key-value pairs, where the key is a string and the value is any. |
BuilderWithDescription | - |
BuilderWithName | - |
HMROptions | Configure whether to use Hot-Module-Replacement (HMR) for your i18next resources using these options. The minimum config to enable HMR is to set enabled to true. Any other properties are optional. |
I18nextFormatters | - |
I18nextNamedCachedFormatter | Represents a cached formatter that is added to i18next with i18next.services.formatter.addCached . |
I18nextNamedFormatter | Represents a cached formatter that is added to i18next with i18next.services.formatter.add . |
InternationalizationClientOptions | - |
InternationalizationContext | Context for InternationalizationHandler.fetchLanguage functions. This context enables implementation of per-guild, per-channel, and per-user localization. |
InternationalizationOptions | The options used in InternationalizationHandler. |
LocalizedData | - |
TFunction | - |
Type Aliases
Type alias | Description |
---|---|
$SpecialObject | This is a re-exported type from i18next. It is the returned type from resolveKey when returnObjects is true in the options. |
BuilderWithNameAndDescription | - |
ChannelTarget | - |
DiscordChannel | - |
I18nextFormatter | Represents a formatter that is added to i18next with i18next.services.formatter.add or i18next.services.formatter.addCached , depending on the cached property. |
TOptions | - |
Target | - |
TextBasedDiscordChannel | - |
Variables
Variable | Description |
---|---|
i18next | - |
version | The @sapphire/plugin-i18next version that you are currently using. An example use of this is showing it of in a bot information command. |
Functions
Function | Description |
---|---|
applyDescriptionLocalizedBuilder | Applies the localized descriptions on the builder, calling setDescription and setDescriptionLocalizations . |
applyLocalizedBuilder | Applies the localized names and descriptions on the builder, calling applyNameLocalizedBuilder and applyDescriptionLocalizedBuilder. |
applyNameLocalizedBuilder | Applies the localized names on the builder, calling setName and setNameLocalizations . |
createLocalizedChoice | Constructs an object that can be passed into setChoices for String or Number option with localized names. |
fetchLanguage | Retrieves the language name for a specific target, using InternationalizationHandler.fetchLanguage. If InternationalizationHandler.fetchLanguage is not defined or this function returns a nullish value, then there will be a series of fallback attempts in the following descending order: 1. Returns Guild.preferredLocale. 2. Returns InternationalizationOptions.defaultName if no guild was provided. 3. Returns 'en-US' if nothing else was found. |
fetchT | Retrieves the language-assigned function from i18next designated to a target's preferred language code. |
getLocalizedData | Gets the value and the localizations from a language key. |
resolveKey | Resolves a key and its parameters. |