Skip to main content

Interface: InternationalizationOptions

@sapphire/plugin-i18next.InternationalizationOptions

The options used in InternationalizationHandler.

since 1.0.0

Properties

backend

โ€ข Optional backend: i18nextFsBackendOptions

The options passed to backend in i18next.init.

since 1.0.0

Defined in

projects/plugins/packages/i18next/src/lib/types.ts:29


defaultLanguageDirectory

โ€ข Optional defaultLanguageDirectory: string

The directory in which "i18next-fs-backend" should search for files.

default rootDirectory/language

since 1.0.0

Defined in

projects/plugins/packages/i18next/src/lib/types.ts:42


defaultMissingKey

โ€ข Optional defaultMissingKey: string

The default value to be used if a specific language key isn't found. Defaults to "default:default".

since 1.0.0

Defined in

projects/plugins/packages/i18next/src/lib/types.ts:49


defaultNS

โ€ข Optional defaultNS: string

The default NS that is prefixed to all keys that don't specify it. Defaults to "default".

since 1.0.0

Defined in

projects/plugins/packages/i18next/src/lib/types.ts:56


defaultName

โ€ข Optional defaultName: string

Used as the default 2nd to last fallback locale if no other is found. It's only followed by "en-US".

since 1.0.0

Defined in

projects/plugins/packages/i18next/src/lib/types.ts:23


formatters

โ€ข Optional formatters: I18nextFormatters[]

Array of formatters to add to i18n.

since 2.0.0

default []

Defined in

projects/plugins/packages/i18next/src/lib/types.ts:64


i18next

โ€ข Optional i18next: InitOptions | DynamicOptions<InitOptions>

The options passed to i18next.init.

since 1.0.0

Defined in

projects/plugins/packages/i18next/src/lib/types.ts:35

Methods

fetchLanguage

โ–ธ Optional fetchLanguage(context): Awaitable<null | string>

A function that is to be used to retrieve the language for the current context. Context exists of a {@link Guild guild}, a channel and a {@link User user}.

If this is not set, then the language will always be the default language.

This will be inserted for InternationalizationHandler.fetchLanguage.

since 2.0.0

default () => InternationalizationOptions.defaultName

Parameters

NameType
contextInternationalizationContext

Returns

Awaitable<null | string>

Defined in

projects/plugins/packages/i18next/src/lib/types.ts:76