Skip to content

feat(agentic-localization): make localizedSchemaTypes array optional#37

Closed
mattymess wants to merge 1 commit into
sanity-labs:mainfrom
mattymess:feat/optional-localized-schema-types
Closed

feat(agentic-localization): make localizedSchemaTypes array optional#37
mattymess wants to merge 1 commit into
sanity-labs:mainfrom
mattymess:feat/optional-localized-schema-types

Conversation

@mattymess

@mattymess mattymess commented May 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Make localizedSchemaTypes optional in the l10n package's createL10n() and stop registering @sanity/document-internationalization when no doc-level types are configured.

Why

@sanity/document-internationalization throws if its schemaTypes array is empty. Because createL10n() always registered it, field-level-only Studios had to keep a placeholder doc-level type to avoid an error from being thrown.

CleanShot 2026-05-07 at 09 35 31@2x

Changes

  • packages/l10n/src/plugin.tslocalizedSchemaTypes?: readonly string[] (defaults to []); documentInternationalization() is only registered when the array is non-empty.
  • .claude/skills/sanity-l10n/SKILL.md — note that localizedSchemaTypes is optional and split Job 2 into doc-level vs. field-level guidance.

Test plan

  1. Remove localizedSchemaTypes from the createL10n initialization
  2. Load the studio
  3. Expect the studio to load with no error thrown

@vercel

vercel Bot commented May 7, 2026

Copy link
Copy Markdown

@mattymess is attempting to deploy a commit to the Sanity Sandbox Team on Vercel.

A member of the Team first needs to authorize it.

@mattymess mattymess had a problem deploying to agentic-localization May 7, 2026 16:42 — with GitHub Actions Error
@mattymess mattymess had a problem deploying to agentic-localization May 7, 2026 16:42 — with GitHub Actions Failure
@mattymess mattymess temporarily deployed to ai-shopping-assistant May 7, 2026 16:42 — with GitHub Actions Inactive
@mattymess

Copy link
Copy Markdown
Contributor Author

Found a bug with this, so closing until I have a chance to come back to it.

@mattymess mattymess closed this May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant