A localized route identifies one language representation while preserving the underlying content identity. Route selection, declared language, navigation, and translation status must agree. Locale prefixes are simple to parse, but the server needs a rule for missing translations, a default language, and old slug redirects. Automatically redirecting every visitor from a request header can prevent sharing a chosen language URL. When content changes, publish each translation only when its facts and task instructions match current product behavior.
Localized Routes and Translation Release
Working case
An English photo-upload guide changes its maximum accepted file size, but its translation still states the old limit. A reader arrives through a saved localized URL and follows outdated instructions. The route returns successfully, so a crawl reports no error, yet the content contract is broken. Tie translated pages to source revision and readiness state. Keep an old translation with an update queue, fall back to current content, or hold the feature for that locale according to risk; do not hide the decision in routing code.
Implementation boundary
const pages = new Map([["upload-photos", { en: "/en/guides/upload-photos", hi: "/hi/guides/photos" }]]);
function pageFor(contentId, locale) { const routes = pages.get(contentId); return routes ? (routes[locale] ?? routes.en) : null; }The map separates content identity from localized slug. It demonstrates one fallback but does not dictate every product's redirect rule: the site may offer a language choice or return a deliberate missing-page result when translation is absent. Preserve old slugs in a redirect table. Generate internal links from content identity and locale, selecting a current translation when one exists. Declare the actual page language; changing only the URL prefix does not translate the body or make its instructions current.
Cost and boundaries
Each localized page adds review, route aliases, link variants, and cache entries. Pre-rendering every locale can lengthen builds and invalidate more pages after shared changes. Stable content IDs limit migrations when slugs are edited; revision metadata exposes stale translations before release. Language negotiation on every request complicates caching, while explicit locale URLs are easier to share and test. Storage for revisions and redirects is small compared with the cost of publishing wrong safety instructions.
Failure trace
An editor renames a Hindi slug and removes the old path. Bookmarks and messages now lead to a missing page. Another internal link from a Hindi guide opens English content while retaining a Hindi language label. Readers lose context, and assistive technology may pronounce text incorrectly. Keep a redirect, generate links from stable identity plus chosen locale, and verify the HTML language declaration. Check translated upload instructions against the current limit before declaring the page ready.
Verification
- Open locale routes directly and inspect declared language, heading, and related links.
- Rename a slug and verify old URL redirects without looping.
- Advance source revision and verify stale translations are flagged before publication.
Practice drill
Change a localized slug in a staging dataset and follow an old saved link. It should reach the new route without a loop. Advance the source guide revision while leaving one translation behind; the release check should flag it. Open every locale route directly, follow a related lesson, and inspect both destination language and displayed body. Do not count a translated title attached to an English body as a successful locale route.
Decision note
Publish a translated route when its content is ready, not when a catalog happens to contain its title. Keep identity, editorial state, and fallback visible to maintainers.
Common Mistakes
- Assuming a locale prefix means the body is translated.
- Deleting old slugs without redirects.
- Serving outdated instructions under a healthy status code.
Connected lessons
Internationalization and Content Delivery; Message Catalog Contracts and Fallback; Currency, Date, and Time-Zone Presentation; Right-to-Left and Mixed-Direction Content; Canonical Route Identity; Internal Link Architecture for Technical Guides; Sitemap and Index Control.
Apply and check
Build Project: localized guide release and review Web Development: inclusive and global delivery quiz.
