> ## Documentation Index
> Fetch the complete documentation index at: https://botmesh.afaya.com.co/llms.txt
> Use this file to discover all available pages before exploring further.

# I18nOptions

> Interface exported by @botmesh/core/spi.

Defined in: [i18n/I18n.ts:52](https://github.com/andresayac/botmesh/blob/main/packages/core/src/i18n/I18n.ts#L52)

Options of the [I18n](https://botmesh.afaya.com.co/api/core/spi/classes/I18n.md) constructor.

## Extends

* [`I18nConfig`](https://botmesh.afaya.com.co/api/core/interfaces/I18nConfig)

## Properties

### logger?

```ts theme={null}
logger?: I18nLogger;
```

Defined in: [i18n/I18n.ts:53](https://github.com/andresayac/botmesh/blob/main/packages/core/src/i18n/I18n.ts#L53)

***

### defaultLocale?

```ts theme={null}
defaultLocale?: string;
```

Defined in: [i18n/types.ts:87](https://github.com/andresayac/botmesh/blob/main/packages/core/src/i18n/types.ts#L87)

Language used when nothing else resolves, and the fallback for missing keys. Default `'en'` (or `BotConfig.lang`).

#### Inherited from

[`I18nConfig`](https://botmesh.afaya.com.co/api/core/interfaces/I18nConfig).[`defaultLocale`](https://botmesh.afaya.com.co/api/core/interfaces/I18nConfig#defaultlocale)

***

### detect?

```ts theme={null}
detect?: LanguageDetector;
```

Defined in: [i18n/types.ts:89](https://github.com/andresayac/botmesh/blob/main/packages/core/src/i18n/types.ts#L89)

Custom detector (see [LanguageDetector](https://botmesh.afaya.com.co/api/core/type-aliases/LanguageDetector.md)).

#### Inherited from

[`I18nConfig`](https://botmesh.afaya.com.co/api/core/interfaces/I18nConfig).[`detect`](https://botmesh.afaya.com.co/api/core/interfaces/I18nConfig#detect)

***

### providerLanguage?

```ts theme={null}
providerLanguage?: boolean;
```

Defined in: [i18n/types.ts:95](https://github.com/andresayac/botmesh/blob/main/packages/core/src/i18n/types.ts#L95)

Use the language the provider reports for the sender (`SenderInfo.language`,
or `platformData.languageCode` / `language` / `locale`, e.g. Telegram's
`language_code`). Default `true`.

#### Inherited from

[`I18nConfig`](https://botmesh.afaya.com.co/api/core/interfaces/I18nConfig).[`providerLanguage`](https://botmesh.afaya.com.co/api/core/interfaces/I18nConfig#providerlanguage)

***

### userKey?

```ts theme={null}
userKey?: string;
```

Defined in: [i18n/types.ts:97](https://github.com/andresayac/botmesh/blob/main/packages/core/src/i18n/types.ts#L97)

`ctx.user` key holding the user's preference (read on every message, written by `ctx.setLang`). Default `'lang'`.

#### Inherited from

[`I18nConfig`](https://botmesh.afaya.com.co/api/core/interfaces/I18nConfig).[`userKey`](https://botmesh.afaya.com.co/api/core/interfaces/I18nConfig#userkey)

***

### locales?

```ts theme={null}
locales?: readonly string[];
```

Defined in: [i18n/types.ts:106](https://github.com/andresayac/botmesh/blob/main/packages/core/src/i18n/types.ts#L106)

Allow-list of the languages the bot serves (e.g. `['en']` for a bot whose
content — persona, flows, button titles — is only in English). A stored
preference, provider-reported or detected language outside it is ignored, so
resolution falls back to `defaultLocale` (always served); `ctx.setLang()`
refuses it. Regional variants follow their base (`'en'` serves `'en-GB'`).
Default: every registered locale (the built-in `es` and `en` included).

#### Inherited from

[`I18nConfig`](https://botmesh.afaya.com.co/api/core/interfaces/I18nConfig).[`locales`](https://botmesh.afaya.com.co/api/core/interfaces/I18nConfig#locales)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.