Repository navigation
Conversation
alexdeia
force-pushed
the
fix/localized-field-descriptions
branch
from
November 18, 2026 14:34
187430a to
deba174
Compare
This branch has not been deployed
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.
What
Pass the build context's
i18nthrough to Payload'sentityToJSONSchemawhen building collection, global and block schemas. It was always passed asundefined.Why
When a field (or entity) has a locale-keyed
admin.descriptionwithout anenkey, e.g.admin: { description: { de: 'Titel' } }, Payload'sentityOrFieldToJsDocsreadsdescription[i18n.language]and throwsTypeError: Cannot read properties of undefined (reading 'language').buildDocumentcatches it and the whole collection is dropped from the spec with only a warning:With
i18npassed, the description resolves in the request language and the collection is documented.The same bug is in
0.x(0.2.3, Payload 3): theretoComponentSchemainsrc/spec/entitySchemas.tsalso passesundefinedfori18n. The same two-line change fixes it there, in case you want to cherry-pick it.How I tested it
spec/entitySchemas:resolves a locale-keyed field description without an \en` key. It fails without the fix with theTypeError` above and passes with it.pnpm typecheck,pnpm lint,pnpm format,pnpm test:unit(184 passed),pnpm test:int(98 passed)./api/openapi.json.Checklist
pnpm typecheck && pnpm lint && pnpm format && pnpm test:unitpassREADME.mdanddocs/updated if users will notice the change (not needed: no option or behavior users configure)fix: ...,feat: ...)