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](https://gloteo.com/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.
เช็กลิสต์การติดตั้ง
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.
ข้อผิดพลาดที่พบบ่อย
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.
พื้นฐานสำหรับการค้นหาแบบดั้งเดิมและเครื่องมือค้นหาคำตอบ
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.
คู่มือแพลตฟอร์ม: Google Search
สำหรับ Google Search การค้นพบหน้าเว็บขึ้นอยู่กับ URL ของแต่ละพื้นที่ที่โปรแกรมรวบรวมข้อมูลเข้าถึงได้ โดยใช้ HTML ที่เหมาะกับภาษานั้น ชื่อหน้าและหัวข้อที่ถูกต้อง และ hreflang ที่อ้างอิงถึงกันเมื่อมีหน้าทางเลือก พื้นฐานทางเทคนิคได้แก่ เนื้อหาที่จัดทำดัชนีได้ (ไม่ใช่การสลับภาษาด้วยคุกกี้เพียงอย่างเดียว) เมทาดาทาที่ปรับให้เข้ากับท้องถิ่น Sitemap และการจัดการ canonical อย่างรอบคอบ คุณภาพเนื้อหาหมายถึงการมีเนื้อหาหลักที่ยึดผู้คนเป็นหลักในแต่ละภาษา ส่วนความน่าเชื่อถือมาจากการระบุองค์กรอย่างชัดเจนและแหล่งข้อมูลที่ยืนยันข้อเท็จจริง ไม่ใช่การโฆษณาเครื่องมือแปล ผลต่อเนื้อหาหลายภาษาคือ URL ของแต่ละตลาดหรือภาษาต้องสมบูรณ์ในตัวเอง วัดผลด้วยการตรวจสอบความครอบคลุมใน Search Console และ URL Inspection แยกตามพื้นที่ สิ่งที่ทราบและไม่แน่ชัด: Google อธิบายแนวทางเกี่ยวกับเนื้อหาหลายภาษาและ hreflang ไว้ แต่ไม่ได้รับประกันอันดับจาก CMS หรือขั้นตอนการทำ MTPE ใด ๆ
คู่มือแพลตฟอร์ม: Bing
Bing ค้นพบและจัดทำดัชนีหน้าเว็บหลายภาษาที่โปรแกรมรวบรวมข้อมูลเข้าถึงได้ โดยมีโครงสร้างชัดเจน คล้ายกับความคาดหวังของ Google ในเรื่องความชัดเจนของ URL และเนื้อหา พื้นฐานทางเทคนิคได้แก่ URL ของแต่ละพื้นที่ที่ดึงข้อมูลได้ เนื้อหาที่เป็นประโยชน์ และการติดตามผ่าน Bing Webmaster Tools ควรใช้หัวข้อ ข้อกล่าวอ้าง และคำถามที่พบบ่อยซึ่งปรับให้เข้ากับท้องถิ่น แทนการแปลเฉพาะส่วนประกอบของหน้าเว็บ สัญญาณความน่าเชื่อถือยังคงขึ้นอยู่กับแหล่งข้อมูลที่ไว้วางใจได้และเอนทิตีที่สอดคล้องกัน ผลต่อเนื้อหาหลายภาษาคือ อย่าซ่อนภาษาต่าง ๆ ไว้หลังปุ่มสลับภาษาที่ทำงานเฉพาะฝั่งไคลเอนต์ วัดการจัดทำดัชนีและสถิติการรวบรวมข้อมูลใน Bing Webmaster Tools สิ่งที่ทราบและไม่แน่ชัด: แนวทางของ Bing เน้นเนื้อหาที่เป็นประโยชน์และโปรแกรมรวบรวมข้อมูลเข้าถึงได้ อย่ากุเรื่องปัจจัยจัดอันดับเฉพาะของ Bing ที่เกี่ยวกับเครื่องมือแปล
คู่มือแพลตฟอร์ม: ChatGPT
ChatGPT อาจอ้างอิงหรือสรุปหน้าเว็บที่เข้าถึงได้แบบสาธารณะ เมื่อมีเวอร์ชันภาษาที่ชัดเจนและพร้อมใช้ตอบคำถาม การค้นพบเนื้อหาไม่ได้อาศัยการจัดอันดับจากการรวบรวมข้อมูลแบบทั่วไป แต่การมองเห็นคือการได้รับเลือกเป็นแหล่งข้อมูลหรือถูกอ้างถึงในคำตอบ พื้นฐานทางเทคนิคยังคงเริ่มจาก URL ที่มี HTML ซึ่งเข้าถึงได้ ไม่ใช่วิดเจ็ตซ้อนทับที่ซ่อนข้อความ คุณภาพของเนื้อหาที่ช่วยได้ ได้แก่ คำตอบตรงประเด็น คำถามที่พบบ่อย และการใช้คำศัพท์อย่างสม่ำเสมอตามอภิธานศัพท์ ความน่าเชื่อถือมาจากหลักฐานและการใช้ชื่อเอนทิตีอย่างสอดคล้องกันในแต่ละภาษา ข้อควรคำนึงสำหรับหลายภาษา: หน้าในแต่ละภาษาควรอ่านเข้าใจได้ด้วยตัวเอง การวัดผลยังไม่สมบูรณ์—ควรมองการตรวจสอบการอ้างอิงเป็นสมมติฐาน สิ่งที่ทราบกับสิ่งที่ยังไม่แน่ชัด: ไม่มีหลักประกันที่มีเอกสารรองรับว่า MTPE หรือการผสานรวมกับ CMS ใด ๆ จะทำให้ได้รับการอ้างอิงจาก ChatGPT
คู่มือแพลตฟอร์ม: Gemini
Gemini และประสบการณ์ AI อื่น ๆ ที่เกี่ยวข้องกับ Google ได้ประโยชน์จากการใช้เอนทิตีอย่างสอดคล้องกัน ข้อมูลที่มีโครงสร้างเมื่อถูกต้องแม่นยำ และหน้าที่แปลเป็นภาษาท้องถิ่นซึ่งจัดทำดัชนีได้ การมองเห็นหมายถึงการได้รับการอ้างอิงหรือจดจำ ไม่ใช่การแต่งปัจจัยการจัดอันดับของ Gemini ขึ้นมาเอง พื้นฐานทางเทคนิคสอดคล้องกับความสามารถในการรวบรวมข้อมูลของ Google Search และคุณภาพของเมทาดาทา เนื้อหาควรนำเสนอข้อกล่าวอ้างและคำจำกัดความอย่างชัดเจนในแต่ละภาษา ความน่าเชื่อถือขึ้นอยู่กับการใช้ชื่อองค์กรอย่างสม่ำเสมอและการมีข้อมูลยืนยัน ข้อควรคำนึงสำหรับหลายภาษา: การควบคุมชื่อผลิตภัณฑ์ด้วยอภิธานศัพท์ช่วยลดความสับสนระหว่างภาษา วัดผลตามปกติด้วย Search Console และสุ่มตรวจคำตอบจาก AI ในเชิงคุณภาพ สิ่งที่ทราบกับสิ่งที่ยังไม่แน่ชัด: พฤติกรรมของ Gemini ใช้แทนแนวทางที่มีเอกสารรองรับของ Google Search เกี่ยวกับ hreflang และเวอร์ชันภาษาไม่ได้
คู่มือแพลตฟอร์ม: Google AI Overviews
Google AI Overviews อาจใส่ลิงก์ไปยังหน้าที่ใช้สนับสนุนข้อมูล แต่หลักเกณฑ์ด้านการมีสิทธิ์ยังคงยึดเนื้อหาที่ให้ความสำคัญกับผู้ใช้และจัดทำดัชนีได้ ฟีเจอร์นี้ไม่ใช่เครื่องมือเปลี่ยนภาษาและใช้แทน hreflang ไม่ได้ พื้นฐานทางเทคนิคยังคงเป็น HTML ของแต่ละภาษาที่รวบรวมข้อมูลได้และข้อมูลที่มีโครงสร้างซึ่งตรงตามความจริง คุณภาพของเนื้อหาประกอบด้วยคำตอบกระชับและหัวข้อที่ชัดเจนในแต่ละภาษา สัญญาณด้านความน่าเชื่อถือเป็นไปตามความคาดหวังของเนื้อหาที่เป็นประโยชน์ ข้อควรคำนึงสำหรับหลายภาษา: ไม่มีการรับประกันว่าหน้าแปลใด ๆ จะปรากฏใน AI Overviews วัดผลด้วยรายงาน Generative ใน Search Console หากมีให้ใช้งาน และแยกจากตัวชี้วัดการจัดทำดัชนีแบบดั้งเดิม สิ่งที่ทราบกับสิ่งที่ยังไม่แน่ชัด: ไม่มีเวิร์กโฟลว์การแปลใดรับประกันการปรากฏใน AI Overviews ได้
GlotEO ช่วยอะไรได้บ้าง
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.
แหล่งอ้างอิง
- แนวทางที่อ้างอิงในบทความนี้ (หลักเกณฑ์สำหรับผู้ดูแลเว็บของ Bing)
- แนวทางที่อ้างอิงในบทความนี้ (วิธีกำหนด URL หลักด้วย rel=canonical และวิธีอื่น ๆ)
- แนวทางที่อ้างอิงในบทความนี้ (การสร้างเนื้อหาที่เป็นประโยชน์ น่าเชื่อถือ และให้ความสำคัญกับผู้ใช้)
- แนวทางที่อ้างอิงในบทความนี้ (แจ้ง Google เกี่ยวกับหน้าเวอร์ชันภาษาต่าง ๆ)
- แนวทางที่อ้างอิงในบทความนี้ (การจัดการเว็บไซต์หลายภูมิภาคและหลายภาษา)
- แนวทางที่อ้างอิงในบทความนี้ (เรียนรู้เกี่ยวกับแผนผังเว็บไซต์)