Skip to main content

Interface: InternationalizationOptions

@sapphire/plugin-i18next.InternationalizationOptions

The options used in InternationalizationHandler.

Since

1.0.0

Properties

backend

Optional backend: Options<object>

The options passed to backend in i18next.init.

Since

1.0.0

Defined in

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


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:86


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:93


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:100


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:67


fetchLanguage

Optional fetchLanguage: (context: InternationalizationContext) => Awaitable<null | string>

A function that is to be used to retrieve the language for the current context. Context exists of a Guild guild, a channel and a 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

Type declaration

▸ (context): Awaitable<null | string>

Parameters
NameType
contextInternationalizationContext
Returns

Awaitable<null | string>

Defined in

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


formatters

Optional formatters: I18nextFormatter[]

Array of formatters to add to i18n.

Since

2.0.0

Default

[]

Defined in

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


hmr

Optional hmr: HMROptions

Reload languages and namespaces when updating the languages directory.

Since

2.2.0

Defined in

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


i18next

Optional i18next: InitOptions<object> | DynamicOptions<InitOptions<object>>

The options passed to i18next.init.

Since

1.0.0

Defined in

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