Translating a Next.js Website: Crawlable Locale Routes and SEO
Learn how to translate a Next.js site with path-based locale URLs, localized metadata, hreflang, and a maintainable glossary workflow—without cookie-only language switches.
![Translating a Next.js Website: a Next.js app-router folder tree with a [locale] node feeding a page on a white grid](/images/blog/translating-a-nextjs-website/translating-a-nextjs-website-hero.970f6828.webp)
Translating a Next.js website is not only an i18n library exercise. Search engines need distinct, crawlable URLs for each language version, with metadata and body copy rendered in the initial HTML response. Cookie-based locale switches or client-only toggles on a single URL leave Google without separate pages to index.
Quick answer: crawlable locale routes beat cookie switches
If you need a single rule before diving into App Router segments: give every language its own crawlable URL. Google recommends different URLs per language or region rather than relying on cookies or browser language alone. Path prefixes such as /en/ and /de/, dedicated subdomains, or separate domains each create indexable addresses. Cookie-only switches on one URL do not.
Cookie-based locale switching can feel convenient during development because you avoid duplicating routes. In production SEO, that pattern hides language variants from crawlers. Path-based locales expose stable addresses you can list in sitemaps, annotate with hreflang, and monitor in Search Console. For a deeper framing of market versus language strategy, see our guide on international SEO versus multilingual SEO.
Choose a Next.js URL pattern for languages
Next.js teams usually pick one of three crawlable patterns:
- Subdirectories —
example.com/en/docs,example.com/fr/docs. Easy to deploy on one host; clear hierarchy for hreflang. - Subdomains —
en.example.com,fr.example.com. Useful when regional teams operate semi-independently; still needs reciprocal hreflang. - ccTLDs or dedicated domains — strongest geographic signal when you truly operate separate properties; highest operational overhead.
Google determines page language primarily from visible content. Whichever pattern you choose, keep each URL predominantly in one language—including navigation, footer links, and error pages. Avoid mixing languages on the same template without a clear user-facing reason.
Do not automatically redirect visitors based on guessed language or location. Google advises against that behavior because it can block crawlers and frustrate users. Offer a visible language selector that links to the alternate locale URL instead.
App Router and locale segment design
In the App Router, a dynamic [locale] segment is the common pattern: app/[locale]/layout.tsx wraps localized pages. Define supported locales in one config object and validate params.locale in layouts or middleware. Invalid locales should 404, not silently fall back to English on the same URL.
Middleware can redirect bare / to a default locale folder such as /en/, but keep alternates linkable. Pair middleware with generateStaticParams when you statically generate marketing pages so each locale builds ahead of time.
Cookie vs path locales: Cookie or header negotiation on a single URL changes content without changing the address. Crawlers typically fetch one URL once; they will not see every language variant. Path-based locales (or subdomain/domain equivalents) align with Google’s different-URL guidance. Cookies may still store user preference after they choose a language, as long as public URLs remain distinct.
Use next-intl, next-i18next, or similar libraries for message loading, but let routing—not cookies alone—define public URLs.
Localize metadata, Open Graph and structured data
Each locale route needs its own <title>, meta description, canonical, and Open Graph tags in the server-rendered HTML. In App Router, use generateMetadata per page, reading translated strings from your message files. Localized title and meta description should not depend on a client-side language swap after hydration.
Apply the same discipline to JSON-LD: WebPage, Organization, and FAQ blocks should use translated strings and locale-appropriate inLanguage values. If you emit hreflang link elements, generate the full reciprocal set in the layout or page metadata helper—missing return links break hreflang clusters.
Hreflang, canonicals and sitemaps for Next.js
Hreflang tells Google about alternate language or regional URLs. Every URL in a cluster must reference every other member, including itself, with matching codes. Implement hreflang in <head>, HTTP headers, or XML sitemaps via xhtml:link entries—pick one consistent method per site.
Each locale URL also needs a canonical pointing to the preferred URL for that language when duplicates exist (for example, tracking parameters or print views). Do not canonical a French page to its English equivalent; canonicals consolidate duplicates within the same language.
Generate per-locale sitemaps or one sitemap index listing all language URLs. Sitemaps improve discovery and can carry hreflang annotations. After deploy, verify samples with Search Console URL Inspection and an hreflang testing workflow. Our multilingual SEO platform overview explains how SEO teams audit these signals across locales.
Avoiding client-only language shells
A frequent Next.js pitfall is rendering an English HTML shell, then swapping strings in useEffect. Crawlers may not execute that swap reliably; users see a flash of wrong language. Server Components, static generation, or SSR should render translated copy in the first response. Client Components can hydrate interactive pieces, but marketing copy and headings belong in the server tree.
Path- or subdomain-based locale routes create distinct crawlable URLs; cookie-only locale switches do not meet Google’s recommendation. If you use a translation proxy for preview, ensure production still serves complete HTML per locale URL.
Content workflow: glossary, TM and review
Engineering choices fail in market when translations drift from product terminology. Layer a glossary, translation memory (TM), and human review on top of Next.js i18n files. Google helpful-content guidance prioritizes people-first pages; thin or boilerplate-only language versions are weak SEO and weak answer sources.
Workflow sketch:
- Extract strings from JSON or PO files into a CAT-friendly pipeline.
- Enforce glossary terms for product names and UI labels.
- Run linguistic QA on staging URLs, not just diffing source files.
- Re-sync when English source changes; stale locales erode trust.
Implementation checklist
Before launch, confirm crawl paths, metadata, and annotations:
Bing Webmaster Guidelines also emphasize crawlable, useful content and clear structure—patterns that help Google generally help Bing indexing too.
Common mistakes
Cookie-only locale on one URL — hides variants from crawlers.
Missing return hreflang links — breaks reciprocity and weakens clustering.
English canonical on translated pages — sends the wrong consolidation signal.
Client-only metadata — titles/descriptions absent from initial HTML.
Auto-redirect by IP or Accept-Language — blocks crawlers and ignores user choice.
Untranslated chrome — mixed-language navigation confuses language detection.
Thin machine translation without review — fails helpful-content expectations.
Traditional search and answer-engine foundations
Shared foundations for Next.js locale routes and server-rendered HTML still matter across Google, Bing, and answer engines: crawlable language versions, clear entities, evidence-backed claims, structured data where truthful, and real localization—not English-only shells. Treat the guides below as platform-specific lenses on the same multilingual delivery bar.
Platform guide: Google Search
For Google Search, discovery depends on crawlable locale URLs with language-appropriate HTML, accurate titles/headings, and reciprocal hreflang when alternates exist. Technical foundations include indexable content (not cookie-only switches), localized metadata, sitemaps, and canonical discipline. Content quality means people-first main content in each language; authority comes from clear organization identity and corroborating sources—not translation-tool marketing. Multilingual implication: each market or language URL must stand alone. Measure with Search Console coverage and URL Inspection per locale. Known vs uncertain: Google documents multilingual and hreflang behavior; it does not guarantee rankings from any CMS or MTPE workflow.
Platform guide: Bing
Bing discovers and indexes crawlable multilingual pages with clear structure, similar to Google’s URL and content clarity expectations. Technical foundations include fetchable locale URLs, useful content, and Bing Webmaster Tools monitoring. Prefer localized headings, claims, and FAQs over chrome-only translation. Authority signals still depend on trustworthy sources and consistent entities. Multilingual implication: do not hide languages behind client-only toggles. Measure indexation and crawl stats in Bing Webmaster Tools. Known vs uncertain: Bing guidelines emphasize crawlable useful content; do not invent Bing-only ranking factors for translation tooling.
Platform guide: ChatGPT
ChatGPT may cite or summarize publicly accessible pages when language versions are clear and answer-ready. Discovery is not a conventional crawl ranking; visibility looks like being selected as a source or referenced in answers. Technical foundations still start with accessible HTML URLs—not widget overlays that hide copy. Content qualities that help include direct answers, FAQs, and stable terminology from glossaries. Authority comes from evidence and consistent entities across locales. Multilingual implication: each locale page should be readable on its own. Measurement is imperfect—treat citation checks as hypotheses. Known vs uncertain: there is no documented guarantee that MTPE or any CMS integration produces ChatGPT citations.
Platform guide: Gemini
Gemini and related Google AI experiences benefit from coherent entities, structured data where accurate, and indexable localized pages. Visibility is about being referenced or recognized—not inventing Gemini ranking factors. Technical foundations overlap Google Search crawlability and metadata quality. Content should present clear claims and definitions per language. Authority depends on organization consistency and corroboration. Multilingual implication: glossary-controlled product names reduce cross-locale confusion. Measure traditionally via Search Console and qualitatively sample AI answers. Known vs uncertain: Gemini behavior is not a substitute for documented Google Search guidance on hreflang and language versions.
Platform guide: Google AI Overviews
Google AI Overviews may link supporting pages; eligibility framing still rests on people-first, indexable content. They are not a language switch and do not replace hreflang. Technical foundations remain crawlable locale HTML and truthful structured data. Content qualities include concise answers and clear headings in each language. Authority signals mirror helpful-content expectations. Multilingual implication: Overview inclusion is not guaranteed for any translated page. Measure Search Console generative reports where available and keep traditional index metrics separate. Known vs uncertain: no translation workflow can promise Overview placement.
Where GlotEO fits
Hand-rolled Next.js i18n works for small sites; scale adds glossary control, review queues, and SEO validation across locales. GlotEO connects to modern stacks so marketers manage translations while engineers keep App Router structure.
Teams that treat localization as a routing and content-quality problem—not only a string swap—ship faster iterations without breaking crawl paths. Share a glossary before translators start, review pages in context on staging, and re-check hreflang whenever you add routes. Measure indexing in Search Console per locale folder or subdomain rather than relying on a single-site aggregate.
Explore the website localization platform at GlotEO website localization and compare GlotEO pricing and plans when scoping rollout.
Citations
- Supports guidance cited in this article (Bing Webmaster Guidelines)
- Supports guidance cited in this article (How to specify a canonical URL with rel=canonical and other methods)
- Supports guidance cited in this article (Creating helpful, reliable, people-first content)
- Supports guidance cited in this article (Tell Google about localized versions of your page)
- Supports guidance cited in this article (Managing multi-regional and multilingual sites)
- Supports guidance cited in this article (Learn about sitemaps)