pedro@portfolio ~ % open ./projects/starter-i18n

open sourceOpen Source

Sanity × Next.js × Cloudflare i18n Starter

The multilingual edition of my edge starter — localised routes, translated posts and hreflang out of the box.

role
Author & maintainer
year
2026
Demo landing page in English, with the language switcher in the header.

3

locales: en · pt · pl

3

translation layers

~ % cat README.md

Overview

The i18n edition of my Sanity × Next.js × Cloudflare starter. It keeps the same stack — Sanity 5 with Visual Editing, Next.js 16 and Cloudflare Workers via OpenNext — and adds English, Portuguese and Polish with locale-prefixed URLs (/en, /pt, /pl).

Translation is split by layer: developer-written UI strings live in next-intl message files, blog posts are translated in Sanity as one document per language (linked as translations of each other), and pages and site settings stay single-locale by design. It later became the base architecture for the Fundacja Portugalia rebuild.

~ % ls ./features

What it does

7 items

Localised routing

next-intl with a [locale] segment and localePrefix: always; / redirects to /en, and every page is statically generated per locale.

Document-level translations

Posts are translated with @tinloof/sanity-document-i18n: each language is its own document with a localised slug, linked through translation metadata.

Language switcher

Swaps the locale on the same path; on a post it jumps to the translated post’s own URL, or to that language’s post list if no translation exists.

No silent fallbacks

Post listings only show posts that exist in the current language — missing translations never fall back to English.

hreflang & sitemap

Language alternates in page metadata and a sitemap with per-locale entries and alternates for static pages, CMS pages and every translated post.

Locale-aware Studio

The Pages navigator and Presentation tool resolve each document to its localised URL, so editors preview a post in its own language.

Visual editing & page builder

Everything from the base starter: live preview, drag-and-drop sections, AI alt text and Unsplash images.

~ % cat CHANGELOG.md

Highlights

  • ▸Works around Next.js 16’s Node-only middleware, which OpenNext for Cloudflare doesn’t support yet: the root redirect is a page, and locale resolution happens in the route segment.
  • ▸Open Graph locale and alternate locales set per language in the root metadata.
  • ▸One-click “Deploy to Cloudflare Workers” button and documented steps for translating the bundled sample posts.

~ % ls ./screenshots

Gallery

2 images
The same page under /pt, translated through next-intl.
Polish post list — only posts translated into Polish are shown.

next › ./projects/aura

Aura