Skip to content

Next.js i18n · TypeScript

Next.js i18n for the App Router, from server to client.

Palamedes gives Next.js 16 one translation model across Server Components, Client Components, and server actions. The Next plugin handles macro transforms and catalog loading; your application keeps control of routing and locale policy.

Integration
@palamedes/next-plugin

One host adapter for macro transforms and PO imports.

Verified against
Next.js 16.2

App Router with the current Turbopack path.

Rendering
RSC + client

Server Components, Client Components, and server actions.

Locale models
4 examples

Cookie, route, subdomain, and top-level domain.

npm package@palamedes/next-pluginv1.17.35.9K downloads / month

01 — The framework problem

Next.js makes locale routing visible. The harder boundary is request-local rendering.

A locale segment or cookie is only the first decision. Translations must resolve to the same locale while React crosses server and client boundaries, streams HTML, hydrates the browser, and runs a server action later.

02 — The Palamedes model

Keep the framework-specific wiring at the edge of one i18n model.

Palamedes treats Next.js as a host, not as a separate translation architecture. The adapter owns the build integration while the core keeps message identity, catalogs, diagnostics, and runtime access consistent.

A native Next.js build path

withPalamedes() transforms TypeScript macros and compiles imported PO catalogs for Turbopack, with webpack available as a fallback.

Request-scoped server i18n

A server-only scope binds getI18n() to the active request so downstream Server Components and actions use the right locale.

The same authoring model

Write t and Trans next to the component. Server and client code share source-string-first catalogs instead of maintaining parallel APIs.

03 — In TypeScript

The adapter is visible in config. The translation stays beside the UI.

next.config.ts + app/page.tsx

// next.config.ts
import { withPalamedes } from "@palamedes/next-plugin"

export default withPalamedes({})

// app/page.tsx — a Server Component
import { t } from "@palamedes/core/macro"
import { createActiveServerI18n } from "@/lib/i18n.server"

export default async function Page() {
  await createActiveServerI18n()
  return <h1>{t`Welcome to Palamedes`}</h1>
}

The server helper resolves the locale, loads its catalog, and activates a request-local scope once. The checked example also initializes the client boundary and verifies a localized server action.

04 — Locale strategy

Choose the URL model that fits your Next.js product.

Next.js owns URL structure and request handling. Palamedes supplies typed locale controls and the same catalog runtime for all four patterns, so choosing an SEO-friendly route segment does not require choosing a different translation library.

Cookie

One URL for all locales. Best for apps behind login where SEO is irrelevant and switching should be instant.

open demosource →

Route segment

/de/checkout-style paths. The SEO-friendly default for public content with indexable localized pages.

open demosource →

Subdomain

de.example.com. Clean separation per market, works well with regional CDNs and analytics splits.

open demosource →

Top-level domain

example.de vs example.com. Maximum market trust; Palamedes maps each domain to its locale.

◌ local / CIsource →

Compare the four locale strategies →

05 — Proof and boundaries

A real App Router application, exercised like a user would use it.

The Next.js family is part of the repository's browser-verification matrix. The checks start the application, inspect server-rendered output, switch locale, and invoke translated server behavior.

Initial response
SSR checked

The expected locale is present before hydration.

Interaction
Switch checked

Copy, plurals, dates, and currency move together.

Server behavior
Action checked

A server action returns localized output after interaction.

Evidence
Source + CI

Examples, verifier, and screenshots are checked in.

06 — Questions

Next.js i18n questions, answered

The short version of the decisions that usually block an implementation.

Does Palamedes replace Next.js internationalized routing?
No. Next.js still owns routes, redirects, middleware, and URL design. Palamedes handles translated messages, catalogs, diagnostics, and the runtime that follows the locale your application resolved.
Does Next.js i18n work in Server Components?
Yes on the verified Node runtime path. Initialize one request-local server scope before downstream Server Components call Palamedes macros; keep that server-only module outside Edge and client bundles.
Can the same messages run in Client Components and server actions?
Yes. The React runtime initializes the browser-side instance while the server scope serves Server Components and actions. Both consume the same source-string-first catalogs.
How is this different from next-intl?
next-intl is deeply centered on Next.js. Palamedes provides a broader source-to-runtime toolchain with a native core, repository-owned PO or FCL catalogs, semantic merging, audits, and first-party adapters across several hosts. The right choice depends on whether that shared workflow matters to your team.

07 — Keep exploring

See how the same model meets a different host.

See Next.js switch locale without switching i18n models.