docs

Next.js support

The new @linguanahq/next package brings automatic extraction and request-aware translation to Next.js 16 App Router apps. Write ordinary JSX in Server and Client Components; no translation keys or Babel configuration are needed.

terminal
npm install @linguanahq/next

Added

  • withLinguana for next.config. One wrapper adds extraction to Turbopack and webpack, and composes with existing configuration objects or async configuration functions.
  • Server and Client Components. LinguanaProvider resolves the language once per request and hydrates Client Components with the same catalogs. Supported attributes such as title, placeholder, alt, and aria-label are translated too.
  • Explicit messages everywhere. T works in both environments, getTranslations() covers server code such as generateMetadata, and useTranslation() covers Client Components.
  • Language switching without URL changes. LanguageSelector and setLocale() validate the target catalog, store the language cookie, and refresh server content while preserving client state.
  • Build manifests and opt-in upload. next build writes .linguana/manifest.json. Upload and development-only build translation are explicit options with spending limits.
  • Verified catalogs. Embedded and hosted catalogs are checked for scope and integrity; any failure renders source text.

Scope

This release supports the App Router on Next.js 16 with React 19, Turbopack or webpack, and the Node.js runtime. Pages Router, localized URL routing, static export, cacheComponents, Edge runtime certification, and local translation preview are not included. The CLI does not scaffold or detect Next.js apps yet.

Did this page get you to a working result?

On this page

No Headings