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

    Interface ContextI18n

    What buildMessageContext needs to localize a context (implemented by the Bot's I18n).

    interface ContextI18n {
        defaultLocale: string;
        userKey: string;
        enabled: boolean;
        supported(code: unknown): string | undefined;
        translate(
            lang: string | undefined,
            key: string,
            params?: TranslateParams,
        ): string;
    }
    Index
    defaultLocale: string

    Initial ctx.lang (the bot re-resolves it inside the per-chat queue).

    userKey: string

    ctx.user key ctx.setLang() writes.

    enabled: boolean

    Whether per-message language resolution is on; ctx.setLang() refuses otherwise.

    • The registered locale serving code (itself or its base language), else undefined.

      Parameters

      • code: unknown

      Returns string | undefined