The short answer
An i18n setup that survives many languages has five parts:
- One locale registry that every other piece reads: codes, URL segments, hreflang values, Open Graph locales, native names.
- English as the source catalog and one JSON catalog per language, with English as the fallback for any missing key.
- Scripts, not spreadsheets: a coverage check, a step that cuts what is missing into translator-sized chunks, and a merge step that rejects broken placeholders.
- Tests for drift: every page must exist in every language's route tree.
- Locale-aware formatting and lean bundles: numbers and money in the visitor's format, and no translation keys shipped to browsers that never use them.
The search side of this, hreflang, canonicals and which pages deserve translation at all, is in multilingual SEO with Next.js. This post is the engineering underneath.
To see one of the 19 languages in place, open RPMVault in French: the same site, at its own URLs, in French.
1. One registry for every language
A single file lists the 19 locales RPMVault ships, each with its code, hreflang tag, Open Graph locale, English name and native name. The code doubles as the URL segment: /fr/…, /zh-tw/…, with English unprefixed.
Everything else reads from it: the router, the sitemap, the language menu, the hreflang tags, the number formatting. Adding a language is one entry here once its catalog exists.
The registry also owns tag matching, which is fiddlier than it looks. A browser or phone reports tags like pt-BR, zh-Hant-TW or fr-CA. The rule: the region matters only where a regional variant ships (Brazilian Portuguese, Traditional Chinese for Taiwan); otherwise the primary language decides, so fr-CA gets French. Simplified Chinese is not shipped, so zh-CN falls back to English rather than showing Traditional characters. And the legacy code in still means Indonesian.
2. English as the source, one catalog per language
The English catalog holds 4,551 keys shared by the website and the app, plus 98 mobile overrides where the app's English wording differs from the website's. Each language has one catalog file with the same keys, and an optional mobile overrides file. The Expo app reads the same catalogs as the website, so a string translated once is translated in both, and the app's language menu offers the same 19 languages from its next release.
A missing key never shows a raw key like garage.title. It falls back to English, so a half-finished language is still usable, and a newly added English string goes live everywhere at once, translated or not.
3. Three scripts: check, prep, merge
Check prints a table for every language: missing keys, missing mobile overrides, extra keys, empty values and placeholder mismatches. In strict mode it fails when a catalog has empty values or broken placeholders, so it can guard a release. Today all 18 translated languages report zero missing keys and zero placeholder problems.
Prep cuts what one language still needs into chunks of about 350 keys and writes them to a work folder. A chunk is a size a translator can handle in one sitting, whether that translator is a person or an AI agent. Two details matter: prep refuses to wipe a work folder that already contains translated output unless forced, and because existing translations are kept, rerunning it after the English source grows only emits the new keys.
Merge folds the translated chunks back in, with three rules:
- only keys that exist in the English source are taken, so a translator cannot invent keys;
- a value whose
{placeholders}differ from the English, or an empty value, is rejected and reported; it stays untranslated and falls back to English instead of crashing a page or showing{count}to a visitor; - existing keys keep their order and new ones are added in source order, so catalog diffs stay readable in review.
The placeholder check is the one that earns its keep. Machine-assisted translation is fluent and fast, and now and then it translates the variable name inside the braces.
4. Generated routes and a drift test
Every page has to exist under each language prefix. Rather than copying page files, a script mirrors the English routes under app/[locale]/ as thin re-exports of the same page modules, so each language gets its own static URL without a second copy of any page. The script runs after adding, moving or removing a page, and its output is committed.
Forgetting to run it would mean a page that works in English and returns 404 behind every localized link to it. So a test runs the generator in check mode and fails if the mirrored tree has drifted from the English one.
5. Do not ship every string to every browser
Nineteen catalogs of 4,500 keys add up. Some keys are only ever read on the server: page titles and meta descriptions, the home page's motion copy, catalog hub text. A small webpack loader runs on the client build only and strips keys with those prefixes from the catalogs, so they never reach the browser. Server Components and metadata still read the full catalogs.
6. Numbers and money in the visitor's format
Translated words around an English-formatted number still look foreign. The shared formatting code only knew English and Turkish, because that was all the app needed, so the website maps every other language to its own Intl locale tag before formatting money and numbers. With Intl, the same amount reads 1.250,50 € in German and €1,250.50 in American English. Fixing this was a bug report in disguise: money had been formatted in the default language on pages that were otherwise fully translated.
The language menu follows the same principle: every language is listed in its own name, in one scrolling column, so someone who cannot read the current page can still find theirs.
Common questions
Should translation keys be nested or flat?
Flat keys with dotted prefixes (garage.title) make it easy to filter by prefix, as the bundle loader does, and to diff catalogs. Either works if the tooling understands it.
Can I use AI to translate an app?
Yes, if the pipeline checks what comes back. Limit input to keys that exist, reject placeholder mismatches and empty values, and let a missing translation fall back to the source language.
How do I keep translation files out of the client bundle in Next.js?
Read server-only strings in Server Components or metadata functions, and strip those keys from the catalogs in the client build.
What I learned
The source language is a moving target. The tooling's real job is handling the next 50 English strings, not the first 4,500.
Fallbacks make partial work safe. English fallback for missing keys let languages ship as they became good enough, one at a time.
Test the structure, not the words. Route mirrors and placeholders can be checked automatically; that is where translation projects quietly break.