next-intl
TransLocale for Next.js.
Translate nested messages, connect next-intl, and check catalogs before building your app.
1. Install
Run this from your application directory.
npm install @translocale/next next-intl2. Connect your project
Create a cloud project and replace PROJECT_UUID with its ID. The source and target languages must match your local configuration. Adjust the example locales to your project.
npx translocale-next init --api https://translocale.io --project PROJECT_UUID --source en --locales en,fr,arApprove translation access in the browser:
npx translocale-next login --scope translateSign-in is shared with your other TransLocale tools for this project. Keep credentials in developer tooling or CI. Your deployed app reads its own translation files.
3. Wire up your app
Add the plugin to next.config.ts. It connects the generated request configuration and checks your catalogs. Set up locale routes and NextIntlClientProvider using the next-intl App Router guide. Download every configured target locale before building.
import { createTransLocalePlugin } from "@translocale/next/plugin";
export default createTransLocalePlugin()({});4. Translate, review, and download
Inspect the plan before running translate. The example caps the job at 1,000 source characters across its target languages. Waiting stops after two minutes; a timeout leaves the job running.
npx translocale-next plan
npx translocale-next translate --max-characters 1000 --wait
npx translocale-next pull --job JOB_UUID --locale fr --revision 1
npx translocale-next checkReplace JOB_UUID with the completed job ID. Before pulling revision 1, save that revision in the dashboard and review its wording. Choose the exact saved revision you want to ship, then repeat pull for each target locale. Revision 0 is the original generated output.
Normal application builds use saved catalogs and make no paid translation requests.
Already have translations?
Run npx translocale-next discover --source en to find existing catalogs. The archive's discovery guide explains how to initialize from a reviewed candidate. For later updates, sync previews incoming wording against your local edits and a recorded cloud revision; apply only after reviewing its plan hash.
Current limits
- One JSON catalog per locale. Arrays, non-string leaves, and keys containing dots are rejected.
- App Router with webpack has been tested. Turbopack, Pages Router examples, and automatic source-code extraction remain pending.
The service accepts up to 100 KB and 200 messages per source document, with up to 10 target languages. Expanded target messages must also fit the adapter's limits. Read the file compatibility guide.