SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Interface ITranslator

    The translation boundary. Everything user-facing resolves through this interface; nothing in the SDK/UI depends on an i18n framework — only on this surface.

    Fallback contract: a missing key falls back to the authored English literal at the call site (via ITranslator.lookup returning undefined), never to a bare key.

    interface ITranslator {
        language: string;
        has(key: string): boolean;
        lookup(key: string, params?: Record<string, unknown>): string | undefined;
        onChange(listener: (language: string) => void): RemoveListener;
        t(key: string, params?: Record<string, unknown>): string;
    }

    Hierarchy (View Summary)

    Index
    language: string

    The active BCP-47 language tag.

    • true if the active language (or its base) has a message for key.

      Parameters

      • key: string

      Returns boolean

    • Resolve key in the active language, or undefined on a miss (the caller then falls back to its inline English literal).

      Parameters

      • key: string
      • Optionalparams: Record<string, unknown>

      Returns string | undefined

    • Listen for language changes. Returns a remover.

      Parameters

      • listener: (language: string) => void

      Returns RemoveListener

    • Resolve key in the active language. On a miss returns the key itself — use lookup when the caller has a better (English) fallback.

      Parameters

      • key: string
      • Optionalparams: Record<string, unknown>

      Returns string