feat!(i18n-array): Move language identifier from _key to dedicated language field#567
Open
pedrobonamin wants to merge 41 commits intomainfrom
Open
feat!(i18n-array): Move language identifier from _key to dedicated language field#567pedrobonamin wants to merge 41 commits intomainfrom
_key to dedicated language field#567pedrobonamin wants to merge 41 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 9daaaad The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
f91c4f0 to
1b14e54
Compare
0b72f2c to
a095500
Compare
_key to dedicated language field
_key to dedicated language field_key to dedicated language field
_key to dedicated language field_key to dedicated language field
pedrobonamin
commented
Feb 16, 2026
plugins/sanity-plugin-internationalized-array/migrations/keyToLanguageMigration.ts
Outdated
Show resolved
Hide resolved
e92043f to
786257a
Compare
786257a to
863c858
Compare
pedrobonamin
commented
Feb 16, 2026
plugins/@sanity/document-internationalization/src/utils/excludePaths.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
5c27239 to
979499c
Compare
Preview this PR with pkg.pr.new
|
979499c to
c245580
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
fixes #528
fixes #571
New major versions for
@sanity/document-internationalizationand**sanity-internationalized-array**This PR migrates both
sanity-plugin-internationalized-arrayand@sanity/document-internationalizationto store the language identifier in a dedicatedlanguagefield instead of using_keyfor this purpose.When a field has outdated data a warning banner will render to alert users.

Why
Sanity uses
_keyinternally for array item identity, diffing, and reordering. Storing the language ID there caused issues with:Data format change
Before (v4):
After (v5):
How to upgrade
Update GROQ queries from
_key == "en"tolanguage == "en" || _key == "en"until the migration is completed.Run the new bundled migration helper to update existing documents. Create a migration file in your project that imports from
sanity-plugin-internationalized-array/migrations, configures yourdocumentTypes, and exports the migration:Verify everything looks as expected
Update any custom code that reads
_keyas the language identifier to use thelanguagefield instead.Remove
_key == "en"from your queries once migration is complete, since language is now stored inlanguage.We have also added a SKILL to guide your AI agents helping you to migrate your queries and usage of the
_keyidentifier to a language.See the skill here
What to review
Testing