Decisions
0002 · App Router and locales
Next.js App Router with a [locale] segment and a proxy for clean URLs.
La documentación técnica está en inglés.
Status: Accepted · 2026-11
Context
Version 1 used the Pages Router, rendered nothing on the server (_app returned null until mounted), and mixed three i18n systems: next-i18next (configured but not wired), react-i18next and a language stored in localStorage. Search engines saw an empty page in one language.
Decision
- Move to the App Router. Every route lives under
app/[locale]/, which is also the root layout, so<html lang>is correct per locale. - Portuguese has no URL prefix;
/enand/esdo.src/proxy.tsrewrites, canonicalizes/pt/…, and respects an explicit language cookie. NoAccept-Languagesniffing. - Landing and docs are Server Components rendered at build time; the app and the shared viewer are client islands inside static shells.
Consequences
- Every marketing and docs page is indexable, localized and fast;
hreflangalternates are generated. - A static export isn't possible (the proxy needs a runtime). Vercel or any Node host is required.
- Unknown paths under a locale are caught by
[...missing]to render that layout's not-found page.