Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk4 min

Adding a Second Language to a Static Next.js Site Without Changing URLs

A static Next.js site can display translated content, but built-in locale routing and output: 'export' do not fit together as documented. Understand the URL trade-offs before choosing an approach.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Short answer: you can translate a static Next.js site without changing its existing paths for a visitor, but Next.js’s documented internationalized routing does not work with output: 'export'. And if each language must be independently reachable and indexable, serving both at exactly the same URL is a different requirement: the cited Next.js documentation does not describe a supported static-export solution for it.

Decide first whether the second language is an alternate rendering of the same route or a separate page that users and search engines must be able to address. That distinction determines whether preserving every URL is practical or conflicts with conventional locale routing.

As an Amazon Associate I earn from qualifying purchases.

What “without changing a URL” can mean

There are two different goals behind this requirement:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Keep a visitor on the same path while changing the displayed language. For example, a visitor selects French while viewing /about, and the page remains at /about. This is a language-selection behavior, not a distinct locale route.
  • Make both translations independently addressable at the exact same URL. In this case, a request to /about would need to identify which language-specific page to serve, while both versions remain separately discoverable. A single URL does not itself distinguish those pages.

The first goal may be suitable for a user-selected rendering, but it requires language selection and translated content to be handled separately from a locale-bearing route. The official Next.js guides cited here do not provide a complete, supported recipe for serving two static language variants at one exact path. The second goal is an unresolved design constraint in the documented static-export routing model: if translations need their own crawlable addresses, plan on distinct URLs or reconsider the static-only requirement.

Can I use Next.js i18n routing with a static export?

No—not with the built-in internationalized routing described for the Pages Router. The Next.js Pages Router internationalization guide states that “Internationalized Routing does not integrate with output: 'export' as it does not leverage the Next.js routing layer.” The static export guide also lists Internationalized Routing as unsupported.

The Pages Router guide covers locale routing and static generation, including locale variants represented through getStaticPaths. That does not remove the export limitation: generating locale-specific paths is not a workaround for built-in internationalized routing’s incompatibility with output: 'export'.

What the App Router’s documented locale pattern does

For the App Router, Next.js documents placing route files under a [lang] segment. A page might use a path such as /nl-NL/products. A layout or page can load the appropriate language dictionary, set the document’s language, and use generateStaticParams to generate the known locale routes at build time.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

This is a documented way to structure localized routes, but the locale segment is part of the URL. It therefore does not preserve an existing path exactly. See the Next.js App Router internationalization guide for the documented pattern.

What a static export does—and does not decide

With output: 'export', running next build produces an out directory containing HTML, CSS, and JavaScript assets for generated routes. Dynamic routes can be included when their paths are generated. This output can be served by a static web server, but generating files alone does not tell a server which language to return for an identical incoming path.

The static export guide lists rewrites, redirects, headers, proxy, and Internationalized Routing among unsupported Next.js export features. A hosting provider or web server may offer its own path mapping or request handling, but that is host-level configuration—not a Next.js static-export feature. The guide includes an Nginx hosting example to illustrate serving exported files; any custom mapping, fallback, redirect, or request negotiation must be checked against the chosen host.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choose an architecture based on the URL and deployment requirements

Requirement What it implies
Keep a visitor on the same path when they select a language Language selection and translated strings or data must be selected independently of a locale-bearing route. The cited guides do not provide a complete supported static-export recipe for this behavior.
Give each language its own linkable, crawlable page Use distinct locale paths or domains, or reassess whether a static-only deployment is mandatory. The documented App Router pattern uses a locale path segment.
Use the Pages Router’s built-in locale routing Do not combine it with output: 'export'; the Pages Router guide explicitly excludes that combination.
Use App Router locale routes with generated static pages Generate known locale routes, for example with generateStaticParams, and accept that the locale appears in the URL.
Rely on the hosting layer to choose or map files Verify the provider’s support for path mapping, redirects, headers, fallbacks, and any request-dependent behavior. These capabilities are separate from Next.js export support.

Before choosing, check the project’s actual router (Pages Router or App Router), installed Next.js version, required search-indexing behavior, and static host. A host-specific solution should not be presented as a guarantee of Next.js routing behavior.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Practical decision sequence

  1. Decide whether the translations need separate URLs. If users or search engines must be able to request each language independently, identical URLs do not identify which translation is intended. Confirm whether locale paths or domains are acceptable.
  2. Confirm whether static output is mandatory. If it is, account for the export guide’s unsupported features rather than assuming built-in locale routing, rewrites, redirects, headers, or proxy will be available in the export.
  3. Identify the router and inspect its documented pattern. For Pages Router projects, the built-in internationalization guide excludes output: 'export'. For App Router projects, the documented [lang] route pattern changes the path.
  4. Evaluate host-specific behavior separately. If the host must select or map files for the same incoming path, verify the exact behavior and its limits with that provider. Do not assume request-time language negotiation follows from generating static assets.
  5. Choose the trade-off explicitly. Preserve the existing path for a language-selected rendering, or use distinct addresses for independently reachable language pages. If neither trade-off is acceptable, the requirements need to be revisited before implementation.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.