Skip to main content

Next Sanity Starter

Document Level Translation

This demo keeps one document per language. The English and the German version of a page are two documents, linked as translations of each other.

That is how the variant/document-level branch works. The field-level demo runs the same content on main, with every language inside the fields.

What editors see

Every document has a Translations button in its toolbar. It lists the languages, opens the versions that exist and creates the ones that don’t. A new version starts as a copy of the current one, so translators overwrite text instead of filling an empty form.

The Translations menu of the English page. Deutsch opens the German version.
The Translations menu of the English page. Deutsch opens the German version.

The plugin stores the language in a hidden field and links the versions through a small translation.metadata document. Editors never set either by hand.

Page lists show every version, and the subtitle names the language, like /get-started · de. Each version has its own publish button and its own history, so the German page can go live a week after the English one.

Every page appears twice in the list, once per language. The title field holds one language.
Every page appears twice in the list, once per language. The title field holds one language.

What visitors see

Each version has its own slug, modules and SEO fields. The German page can live at /de/ueber-uns while the English one is /about. On this demo both versions share their slugs, because the content came over from the field-level demo.

A missing translation is a missing page. Its address returns a 404, and the language switch takes visitors to that language’s home instead. Search engines only get hreflang links to versions that exist.

Adding a language

A new row in Site languages adds the language. The Translations button offers it on the next Studio load, and every page that should exist in it needs a new version of its own. Pages nobody translates don’t exist in that language.

The few fixed labels of the interface live in code, in web/src/i18n/uiLabels.ts. Until a language gets them there, they show in English.

Home, menu and settings

These exist once per language too. The German menu is a document of its own, so it can link to pages that only exist in German. The Studio won’t publish a second German home.

What it costs

Editors change shared content once per language version. A new image on the English page reaches the German one only when someone adds it there as well.

Pick it when languages differ: their own pages, their own addresses, or teams that publish one language at a time.