Skip to content

Card button aria-label and title not correctly localized #17069

Description

@cbratschi

Describe the Bug

I am seeing [object Object] values for localized collection names in card buttons:

<a type="button" aria-label="[object Object] neu erstellen" class="btn btn--icon btn--icon-style-with-border btn--icon-only btn--size-medium btn--icon-position-right btn--withoutPopup btn--style-icon-label btn--round btn--withoutPopup" title="[object Object] neu erstellen" href="/admin/collections/pages/create"><span class="btn__content"><span class="btn__icon"><svg class="icon icon--plus" height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><path class="stroke" d="M5.33333 9.99998H14.6667M9.99999 5.33331V14.6666" stroke-linecap="square"></path></svg></span></span></a>

Payload uses:

"aria-label": t('general:createNewLabel', {
  label
})

For localized collection labels, label is an object like { en: 'Pages', de: 'Seiten' }. German translation is {{label}} neu erstellen, so interpolating the object becomes [object Object] neu erstellen. Payload’s Button also copies aria-label into title, so both attributes show it.

Correct fix would be:

title = getTranslation(label, i18n)

...

"aria-label": t('general:createNewLabel', {
  label: title
})

Link to the code that reproduces this issue

https://github.com/cbratschi/payload

Reproduction Steps

Check the aria-label text in the admin panel for localized collection labels.

Which area(s) are affected?

area: core

Environment Info

Binaries:
  Node: 26.3.0
  npm: 11.16.0
  Yarn: N/A
  pnpm: N/A
Relevant Packages:

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.5.0: Mon Apr 27 20:39:42 PDT 2026; root:xnu-12377.121.6~2/RELEASE_ARM64_T6031
  Available memory (MB): 65536
  Available CPU cores: 16

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: coreCore Payload functionalitystatus: needs-triagePossible bug which hasn't been reproduced yetv3

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions