Skip to main content

@sapphire/plugin-i18next

Classes

ClassDescription
InternationalizationHandlerA generalized class for handling i18next JSON files and their discovery.

Interfaces

InterfaceDescription
$DictionaryThis is a re-exported type from i18next.
BuilderWithDescription-
BuilderWithName-
HMROptionsConfigure 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-
I18nextNamedCachedFormatterRepresents a cached formatter that is added to i18next with i18next.services.formatter.addCached.
I18nextNamedFormatterRepresents a cached formatter that is added to i18next with i18next.services.formatter.add.
InternationalizationClientOptions-
InternationalizationContextContext for InternationalizationHandler.fetchLanguage functions.
InternationalizationOptionsThe options used in InternationalizationHandler.
LocalizedData-
TFunction-

Type Aliases

Type aliasDescription
$SpecialObjectThis is a re-exported type from i18next.
BuilderWithNameAndDescription-
ChannelTarget-
DiscordChannel-
DynamicOptions-
I18nextFormatterRepresents a formatter that is added to i18next with i18next.services.formatter.add or i18next.services.formatter.addCached,
TOptions-
Target-
TextBasedDiscordChannel-

Variables

VariableDescription
i18next-
versionThe @sapphire/plugin-i18next version that you are currently using.

Functions

FunctionDescription
applyDescriptionLocalizedBuilderApplies the localized descriptions on the builder, calling setDescription and setDescriptionLocalizations.
applyLocalizedBuilderApplies the localized names and descriptions on the builder, calling applyNameLocalizedBuilder and
applyNameLocalizedBuilderApplies the localized names on the builder, calling setName and setNameLocalizations.
createLocalizedChoiceConstructs an object that can be passed into setChoices for String or Number option with localized names.
fetchLanguageRetrieves the language name for a specific target, using InternationalizationHandler.fetchLanguage.
fetchTRetrieves the language-assigned function from i18next designated to a target's preferred language code.
getLocalizedDataGets the value and the localizations from a language key.
resolveKeyResolves a key and its parameters.