Understanding the impact of field level translation in Sanity

5 replies
Last updated: Feb 8, 2024
Hi, I'm researching ways to Localize content in Sanity and in the Sanity docs I read that Portable text shouldn't be used with field level translation. Can someone help explaining me why thats the case and what happens if I do use it?
Feb 8, 2024, 6:01 PM
You eat through your attribute limit and end up getting to a point where your content is stuck unless you run a heavy duty migration.
Feb 8, 2024, 6:27 PM
hey, thanks. it's not very clear to me: does creating seperate documents uses less attributes than adding two portable text fields in one document?
Feb 8, 2024, 6:39 PM
Document level translation means that all translations use the same structure and therefore generate fewer paths. Here’s a super simple example:
Document level (multiple documents but they all use this structure):

{
  name,
  content: {
    //all of the paths the a block array can create
  }
}
Field level:

{
 name: {
  en
  de
  etc.
 }
  content: {
    en: {
       //lots of paths
    },
    de: {
       //lots of paths
   }
}
Feb 8, 2024, 8:15 PM
That’s much clearer now. Thank you
user M
Feb 8, 2024, 9:49 PM
You’re welcome!
Feb 8, 2024, 10:44 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?