Skip to content

Why are field-level translations not recommended for PortableText?

10repliesLast updated: Nov 13, 2026

Hello! I am reading that the
field-level translations
is not recommended for content using
PortableText
. Has anyone tried / knows why this is the case?Source:
https://www.sanity.io/plugins/document-internationalization
AI Update

Portable Text has a deep data structure. When you translate it at the field level, every one of its paths is copied once for each language, so the number of attributes in your dataset grows quickly toward the attribute limit. Sanity's docs recommend document-level localization for content that uses Portable Text.

Why Portable Text and field-level objects don't mix well

An attribute is a unique combination of path and data type in your dataset. Each path counts once, however many documents use it. The attribute limit depends on your plan: 2,000 on Free, and 10,000 on Growth and Enterprise. There's currently no pay-as-you-go option for extra attributes.

A block content field already creates a lot of paths:

If you wrap fields in a language object (body.en, body.fr, body.es …), each language copies that whole set of paths. The attribute-limit docs say: "This multiplies the number of attributes by the number of languages added." Nesting makes it worse, for example Portable Text inside custom objects or page builders.

Create one document per language and link the versions with references. A new language reuses the same fields, so it doesn't add attributes. You can also publish each language on its own schedule. The localization docs list this approach as "best for translating content using Portable Text."

import {defineType, defineField} from 'sanity'

export const articleType = defineType({
  name: 'article',
  title: 'Article',
  type: 'document',
  fields: [
    defineField({
      name: 'language',
      type: 'string',
      options: {list: [{title: 'English', value: 'en'}, {title: 'Spanish', value: 'es'}]},
    }),
    defineField({name: 'title', type: 'string'}),
    defineField({name: 'body', type: 'array', of: [{type: 'block'}]}),
  ],
})

The @sanity/document-internationalization plugin sets the language field for you. It also creates a translation.metadata document that references all the translations. To query a language and its translations:

*[_type == "lesson" && language == $language]{
  title, slug, language,
  "_translations": *[_type == "translation.metadata" && references(^._id)].translations[].value->{title, slug, language}
}

If you need field-level translation

You can choose a strategy per schema, so a project can use both. For field-level translation, use the internationalized-array plugin rather than objects. Each array item stores language and value, so the paths stay fixed (title, title[], title[]._key, title[].language, title[].value) however many languages you add. The plugin supports Portable Text through fieldTypes. The Portable Text structure itself still counts once toward the limit.

Since v5, the plugin stores the language in the language field, and _key is a random stable key. Update older queries from title[_key == "en"][0].value to:

"title": title[language == $language][0].value

Sending documents to a translation service

Document-level translation fits external translation workflows. The localization docs list these options:

Show original thread
10 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