Skip to main content

Next Sanity Starter

Field Level Translation

This demo stores translations inside the fields. A page is one document, and every text field on it holds all languages.

That is how the main branch works. The document-level demo runs the same content on variant/document-level, with one document per language.

What editors see

Every translatable field is a list with one entry per language. Under the field name the Studio shows one input per language, labeled with the language code.

One document per page. Its title field has one input for English and one for German.
One document per page. Its title field has one input for English and one for German.

A language without an entry shows as a button below the field. Clicking it adds that language’s input, so a new German text starts as an empty field next to the English one.

A new page with an empty title field. The EN and DE buttons each add one input for that language.
A new page with an empty title field. The EN and DE buttons each add one input for that language.

A page has one slug, one module stack and one publish button. Publishing sends every language live at once, and the document’s history covers all of them.

What visitors see

Both languages share the address. The English page is /work/localization, the German one /de/work/localization, and the language switch only swaps the prefix.

An empty German field leaves no gap. The site falls back along the order in Site languages and shows the English text, field by field.

Adding a language

A new row in Site languages adds the language. Every translatable field offers it on the next Studio load, and the site serves it under its prefix without a deploy. Until editors fill it in, pages show the fallback text.

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.

Where it stops

All languages share one structure. A module added for German shows up in English as well, with English text or the fallback. A German page under its own address, or one that exists only in German, needs the document-level model.

Pick it when your languages carry the same pages and differ only in their words.