Step 12 of 24
Instale e inicie o Altified.
Execute um inicializador a partir da raiz do seu projeto Next.js para configurar a tradução automática do servidor e o encaminhamento de localidades.
Altified supports Next.js 15 or newer with React 18 or newer. The application must use the App Router. Install the package with the same package manager your project already uses.
pnpm add @altified/next pnpm exec altified initnpm install @altified/next npx altified initThe initializer detects JavaScript or TypeScript and whether the project uses a src/ directory.
- Adds missing server-only settings to .env.local.
- Creates the server client in lib/altified.
- Creates proxy.js or proxy.ts for locale routing.
- Wraps the existing Next config with withAltified for automatic JSX translation.
The initializer does not add visible UI or modify your root layout. You place the language switcher yourself in the exact header, navigation, or other component where it belongs.
Read the command output. A Kept line means an existing file or value was preserved. A warning means the initializer could not safely recognize a custom config; follow the manual example in the next step.
When new copy is not discovered
.next Aceda ao diretório e reinicie ou reconstrua a aplicação.rm -rf .next pnpm devrm -rf .next pnpm build pnpm startVisit the page containing the new copy in the default language and each configured target language. You do not need to run pnpm install or pnpm exec altified init again.