Next.js Blog Starter - How to add a Localized `blockContent` in the `post.js` Schema
Good news - your approach of duplicating the field is actually a perfectly valid solution for simple localization! The issue you're experiencing where body_de doesn't appear in your post payload is almost certainly a GROQ query problem, not a schema problem.
When you query documents in Sanity, you need to explicitly request the fields you want. The Next.js blog starter likely has a GROQ query that fetches post data, and it's probably only requesting the original body field.
Here's what you need to do:
1. Find your GROQ query
Look in your Next.js project for where posts are being fetched. In the blog starter, this is typically in a lib or sanity folder, often in files like queries.js, queries.ts, or directly in your [slug].js page. You're looking for something like:
*[_type == "post" && slug.current == $slug][0] {
title,
body,
slug,
// ... other fields
}2. Add your new field to the projection
Simply add body_de to the list of fields being requested:
*[_type == "post" && slug.current == $slug][0] {
title,
body,
body_de, // Add this line
slug,
// ... other fields
}3. Make sure you're using the correct field name in your component
I noticed in your example you wrote:
<PostBody content={lang === "de" ? post.body : post.body_tr} />But you defined the field as body_de, not body_tr. Make sure these match:
<PostBody content={lang === "de" ? post.body_de : post.body} />This field-level approach is a totally reasonable solution for simple sites, especially when you're just starting out. If you later need more sophisticated localization (many languages, translation workflows, etc.), you can explore document-level localization or the official internationalization plugins, but for a two-language site, your approach is perfectly fine!
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.