Joint session with Vercel: How to build intelligent storefronts (May 15th)

How to localize rich text editor (array of blocks) in Sanity?

6 repliesLast updated: Nov 29, 2025

Looking into localization and sanity. Been using this guide: https://www.sanity.io/docs/localization which works ok for strings. But I need to localize the rich text editor as well (array of block). Any tips on how to create a new localeBlock type?
AI Update

Good news! You're on the right track. The guide you're using is a solid foundation, but you're correct that localizing Portable Text (block content) needs special consideration.

The short answer: For rich text editors (Portable Text/block arrays), you should use document-level localization rather than field-level localization. This means creating separate documents for each language version instead of trying to nest translations within the same document.

Here's why this matters: Field-level localization with Portable Text can quickly hit Sanity's attribute limits because block arrays create numerous unique paths in your data structure. When you multiply that by multiple languages in the same document, you can run into serious issues.

How to implement document-level localization for block content:

{
  name: 'content',
  type: 'array',
  of: [{type: 'block'}]
}
*[_type == "post" && language == "fr"]

The beauty of this approach is that your rich text editor works exactly the same way in all languages - you're just editing different documents. Each language version is independent, which also means translators can work without affecting other languages, and you can publish them on different schedules.

If you need fields that are shared across all language versions (like image galleries), you can maintain those in the base language document and reference them from translations.

Show original thread
6 replies

Was this answer helpful?

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Related contributions