Config

Loader

Defines how translation content is loaded into the system.


loader

defineIntorConfig({
  loader: {...},
});

mode

Specifies the message loading mode.

  • "local": Load translation messages from the local filesystem
  • "remote": Load translation messages over HTTP

Defaults to undefined (Loader disabled).

defineIntorConfig({
  loader: {
    mode: "local",
  },
});

namespaces

local | remote

Specifies the list of top-level namespaces to load.

The same namespace rules apply to both local file system sources and HTTP-based remote sources.

namespaces represents the first-level structure under a locale node:

<root>/
└─ en/
   ├─ index.json        → always included
   ├─ ui.json           → namespace: "ui"
   └─ error/index.json  → namespace: "error"

index is a reserved root node and is always loaded by default.

defineIntorConfig({
  loader: {
    namespaces: ["ui"],
  },
});

// Load result:
// - en/index
// - en/ui/**
// - en/error/** (not specified, ignored)

Local: namespaces is optional. If not specified, all namespaces under the given locale will be loaded by default.
Remote: namespaces is required. If not specified, only the index file under the given locale will be loaded.

concurrency

local

The maximum number of concurrent translation loading operations.

Defaults to 10

rootDir

local

Defines the root path used for resolving local translation messages.

Defaults to "messages".

url

remote

The base URL used to fetch remote translation messages.

headers

remote

Additional HTTP headers sent when requesting remote translation messages.

server.loader / client.loader

Intor allows defining loader configurations per execution environment.

defineIntorConfig({
  server: {
    loader: {
      mode: "local",
      rootDir: "messages",
    },
  },
  client: {
    loader: {
      url: "https://cdn.example.com/messages",
    },
  },
});
  • server.loader: Used in Server environments
  • client.loader: Used in Client environments (remote loader only)