Skip to main content
Defined in: i18n/I18n.ts:52 Options of the I18n constructor.

Extends

Properties

logger?

Defined in: i18n/I18n.ts:53

defaultLocale?

Defined in: i18n/types.ts:87 Language used when nothing else resolves, and the fallback for missing keys. Default 'en' (or BotConfig.lang).

Inherited from

I18nConfig.defaultLocale

detect?

Defined in: i18n/types.ts:89 Custom detector (see LanguageDetector).

Inherited from

I18nConfig.detect

providerLanguage?

Defined in: i18n/types.ts:95 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.providerLanguage

userKey?

Defined in: i18n/types.ts:97 ctx.user key holding the user’s preference (read on every message, written by ctx.setLang). Default 'lang'.

Inherited from

I18nConfig.userKey

locales?

Defined in: i18n/types.ts:106 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.locales