
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeThe _translations query serves a different purpose than your base query with language == $language. Here's why you need it:
Your initial query *[_type == "lesson" && language == $language] only fetches documents in one specific language. The _translations part is what gives you access to all the other language versions of that same content.
Think of it this way:
$language = "en")_translations subquery then looks up and includes the Spanish, French, German, etc. versions of each lessonThe Document Internationalization plugin creates separate documents for each language version, linked together through a special translation.metadata document. The query pattern you're seeing:
"_translations": *[_type == "translation.metadata" && references(^._id)].translations[].value->Does three things:
references(^._id)).translations[]).value->)Why is this useful? It lets you build language switchers, show "Available in: EN, ES, FR" indicators, or prefetch alternate language versions for better UX. Without the _translations query, you'd only have the English lessons with no way to know which other languages exist or how to link to them.
So you're not replacing language == $language with _translations – you're using both together. The first filters to your current language, the second connects you to all the alternatives.
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.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store