Handlers & Hooks

Intor models translation as a unidirectional, inspectable semantic pipeline.

Ordered Pipeline:
resolveLocales → findMessage → loadingmissingformat → interpolate


Handlers

Handlers provide stage-level overrides for specific translation phases.

They allow controlled replacement of built-in behavior for:

  • loading
  • missing
  • format

Handlers operate outside the ordered pipeline.

Hooks

Hooks execute inside the ordered pipeline.

Within the pipeline, they can observe context, modify intermediate results, and extend semantic processing.


Injection

handlers and hooks are injected during initialization and provided through environment-specific entry points.

<IntorProvider
  value={{ handlers, hooks }}
>
  ...
</IntorProvider>
getTranslator(intorConfig, {
  handlers, hooks
});

createIntorHandler(intorConfig, {
  handlers, hooks
});

On this page