Skip to content

fix(ui): resolve card aria-label showing [object Object] for localized labels#17096

Open
ikhana wants to merge 1 commit into
payloadcms:mainfrom
ikhana:fix/card-aria-label-localization
Open

fix(ui): resolve card aria-label showing [object Object] for localized labels#17096
ikhana wants to merge 1 commit into
payloadcms:mainfrom
ikhana:fix/card-aria-label-localization

Conversation

@ikhana

@ikhana ikhana commented Jun 23, 2026

Copy link
Copy Markdown

What?

The createNewLabel aria-label on collection card buttons displays [object Object] instead of the localized collection name when collection labels are defined as multilingual objects (e.g., { en: 'Pages', de: 'Seiten' }).

Why?

Line 106 in CollectionCards/index.tsx passes the raw label object directly to the t() translation function. Since label is an object (not a string), JavaScript coerces it to [object Object]. The other translation calls in the same file (showAllLabel on line 50, editLabel on line 68-69) already resolve the label correctly — this one was missed.

How?

Changed label to label: title on line 106, where title is already resolved via getTranslation(label, i18n) on line 48. One-line change, consistent with the existing pattern in the same file.

Fixes #17069

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.

Card button aria-label and title not correctly localized

1 participant