Step 17 of 23
Publish the language switcher
Use one dashboard configuration for public locale URLs, request locale detection, and the responsive language selector.
Open Language switcher in the project dashboard. Enable it, choose the available languages, order them, configure labels and mobile presentation, then publish the configuration.
- Make the project source language the routing default.
- Choose whether the default locale is hidden from the URL.
- Enable only languages ready for visitors.
- Choose whether switching preserves the current path.
- Preview the switcher, then publish.
The initializer creates a Altified proxy plus a root Next.js routing wrapper. The proxy reads the published configuration, rewrites locale-prefixed requests to your existing App Router pages, and sends the selected locale to Server Components in the x-altified-locale request header.
import { createAltifiedProxy } from "@altified/next/proxy";
export const proxy = createAltifiedProxy({
projectId: process.env.ALTIFIED_PROJECT_ID,
});Next.js 16 calls this feature Proxy. The SDK also creates the root middleware.js wrapper shown below for current compatibility, so keep both generated files in place.
import { proxy } from "./src/proxy";
export default proxy;
export const config = {
matcher: ["/((?!api|_next/static|_next/image|favicon.ico|.*\..*).*)"],
};You do not need to move the application into an app/[locale] directory. A route such as /fr/products/25 is internally served by the existing /products/25 page.
The initializer never inserts the switcher into your layout. Add it exactly where you want it, normally inside your header or navigation. Its options open directly below that control on desktop and mobile:
import { AltifiedLanguageSwitcher } from "@altified/next/switcher";
<AltifiedLanguageSwitcher
projectId={process.env.ALTIFIED_PROJECT_ID}
apiUrl={process.env.ALTIFIED_API_URL}
/>After a visitor selects a language, the proxy keeps that locale while they follow ordinary internal links. For example, from French, a Next.js link to /terms becomes /fr/terms; you do not need to rewrite every Link href.
Published configuration only
ALTIFIED_SECRET_KEY. Dashboard drafts have no effect until published.