i18n-next-intl

Documents conventions and gotchas for a next-intl 4 and Sanity bilingual content stack.

Updated Mar 6, 2026
One-click install
npx skills add https://github.com/ebecerra-developer/ebecerra-web --skill i18n-next-intl-ebecerra-developer
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: i18n-next-intl
Source: https://github.com/ebecerra-developer/ebecerra-web/tree/main/.claude/skills/i18n-next-intl
Command: npx skills add https://github.com/ebecerra-developer/ebecerra-web --skill i18n-next-intl-ebecerra-developer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Maintaining a bilingual (ES/EN) Next.js site with next-intl 4 and Sanity localeString/localeText fields involves many non-obvious conventions: which strings belong in messages JSON versus Sanity, how to query localized fields with fallbacks, and how to avoid cryptic build and migration errors. This Skill captures all of those project-specific rules so changes to translations, pages, and schemas stay consistent. ## Core Features & Use Cases - Content placement policy: Defines exactly which strings live in messages/*.json (a11y labels, ICU plurals, generic errors) versus Sanity singletons (editorial copy), preventing misplaced translations. - Implementation patterns: Provides copy-ready patterns for adding UI strings, creating locale-aware pages with setRequestLocale, and converting Sanity schema fields to localeString/localeText with triple-coalesce GROQ projections. - Troubleshooting guides: Documents fixes for Sanity MCP patch conflicts, Next 16 middleware-to-proxy rename, and Turbopack cache desync causing 500 errors. - Use Case: When adding a new bilingual page or making a Sanity field translatable, follow the documented patterns to update schemas, queries, messages, sitemap, and Studio language filtering without breaking either locale. ## Quick Start Use the i18n-next-intl skill to add a new translatable field to a Sanity schema and wire it through the queries and frontend for both ES and EN locales.

Frequently Asked Questions about i18n-next-intl

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a translatable string with next-intl?▼

Add the key to both messages/es.json and messages/en.json, since a missing key causes a build error. Then call getTranslations in Server Components or useTranslations in Client Components with the appropriate namespace.

How do I make a Sanity field translatable with localeString?▼

Change the schema type from string to localeString or text to localeText, deploy with npx sanity schema deploy, then migrate existing documents. Query with a triple coalesce: coalesce(field[$locale], field.es, field).

Should translated content live in next-intl messages or Sanity?▼

Editorial copy that editors may change belongs in Sanity singletons. Only technical strings stay in messages JSON: accessibility labels, ICU pluralization, and generic error messages like 404 pages.

Why does next dev return 500 errors after moving app routes?▼

Turbopack caches stale paths when files in app/ are moved or middleware is renamed while the dev server runs. Kill the dev process, delete the .next directory, and restart npm run dev.

Why do Sanity MCP patch calls fail with conflicting operation errors?▼

The Sanity MCP rejects combined unset and set on the same path, and multiple operations on different items of one array. Work around this by issuing separate calls per operation and per array item, then publish the drafts.