@botmesh/core - v2.0.0-alpha.2
    Preparing search index...

    Interface I18nConfig

    i18n options — BotConfig.i18n or bot.locale({ ... }).

    interface I18nConfig {
        defaultLocale?: string;
        detect?: LanguageDetector;
        providerLanguage?: boolean;
        userKey?: string;
        locales?: readonly string[];
    }

    Hierarchy (View Summary)

    Index
    defaultLocale?: string

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

    Custom detector (see LanguageDetector).

    providerLanguage?: boolean

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

    userKey?: string

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

    locales?: readonly string[]

    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).