docs

Test your integration

Required scenarios

  1. Render the source locale with only the embedded source catalog.
  2. Switch to a loaded target catalog and verify values and rich component slots.
  3. Request a missing message and assert source fallback plus one missing-translation diagnostic.
  4. Provide invalid ICU content and assert source fallback plus invalid-translation.
  5. Reject remote loading and assert the current/embedded source remains visible plus catalog-load-failed.
  6. Change locale twice quickly and verify the earlier request is aborted.
  7. Verify the linguana_locale cookie and optional preference callback.

SSR precedence

Create requests where override, signed-in preference, cookie, and Accept-Language disagree. Assert the first supported match wins in that order, including language-only matching.

Example diagnostic assertion

const diagnostics: DiagnosticEvent[] = [];

render(
  <LocaleProvider {...props} onDiagnostic={(event) => diagnostics.push(event)}>
    <Page />
  </LocaleProvider>,
);

expect(diagnostics[0]?.code).toBe("missing-translation");

Next

Use Catalog runtime troubleshooting when a browser test fails, then add the checks to CI.

Did this page get you to a working result?

On this page

No Headings