docs

Language files

Load a catalog

const catalog = await loadCatalog({
  endpoint: "https://api.example.com",
  projectId: "your-project-id",
  environment: "production",
  locale: "fr",
  publishableKey: "pk_…",
});

loadCatalog requests the selected language file with x-linguana-key, checks that it belongs to your project, and returns it to the application.

Credentials

A project token authorizes build and translation work and stays in CI. A publishable key allows the app to read published language files and may be configured in browser code. They are not interchangeable.

Fallback order

When a user changes language, LocaleProvider uses a loaded language first and then tries the API. If loading fails, it uses the embedded original language and keeps the page readable.

Verify

Publish a language, request it from the app, and confirm the correct project, environment, and language are returned. Then deny the request and confirm the original language remains readable.

Next

Add integration tests and complete the production checklist.

Did this page get you to a working result?

On this page

No Headings