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

    Function createCommandCatalogService

    • The module-init service that owns command chrome, structured per (scope, language) (I18N-DESIGN.md decision 8). Mirrors DynamicIconService / LanguagePackService.

      Loading model (VSCode-like, one complete pack): each locale catalog is a self-contained, COMPLETE pack (a build step copies untranslated fields from the default — decision #1), fetched at runtime as a data file (not import-inlined, so command strings stay out of the code bundle). The service seeds the active locale's pack into a CommandRegistry via registerStatic(scope, …) — the default en pack only when that locale isn't registered. There is no runtime en ⊕ locale merge and no fallback layer: a German session loads German, not English. A command can be BORROWED into other scopes (ChromeRecord.borrow). On a language switch (observed through DefaultLanguagePackService) it loads the new locale's packs and re-seeds, bumping the registry so bound scopes re-resolve — command localization is single-mechanism (which pack is seeded), not a translator overlay on the resolve path.

      Parameters

      Returns {
          dispose: () => void;
          getActive: () => string;
          getScopeLabel: (scope: string) => string;
          onScopeLabelsChange: (listener: () => void) => RemoveListener;
          prefetch: (tag?: string) => Promise<void>;
          register: (
              scope: string,
              tag: string,
              catalogOrLoader: CommandCatalog | CommandCatalogLoader,
              options?: RegisterCatalogOptions,
          ) => void;
          registerFromManifest: (
              pkg: string,
              fromUrl?: string,
              defaults?: BundledLocaleDefaults,
          ) => Promise<void>;
      }

      • dispose: () => void

        Detach the language subscription (tests / teardown). Singletons are app-lifetime.

      • getActive: () => string

        The active language tag currently feeding the registry.

      • getScopeLabel: (scope: string) => string

        The localized display name for a scope (for the shortcut-keys dialog); the scope key if unknown.

      • onScopeLabelsChange: (listener: () => void) => RemoveListener

        Listen for scope-label changes (e.g. after a language switch). Returns a remover.

      • prefetch: (tag?: string) => Promise<void>
      • register: (
            scope: string,
            tag: string,
            catalogOrLoader: CommandCatalog | CommandCatalogLoader,
            options?: RegisterCatalogOptions,
        ) => void
      • registerFromManifest: (
            pkg: string,
            fromUrl?: string,
            defaults?: BundledLocaleDefaults,
        ) => Promise<void>