Skip to content

Locale-record labels render as [object Object] in three admin aria-labels (dashboard card, sort buttons, document drawer) #19198

Closed

Description

@masu1887

Describe the Bug

Three admin elements pass a collection or field label to t() without resolving it with getTranslation. When the label is a locale record ({ en: 'Posts', sv: 'Inlägg' }, a supported labels / label shape), the interpolated text becomes [object Object]. The visible text next to each element is correct, because those sites do call getTranslation; only the accessible names (and the title tooltip on the dashboard button) are wrong, so screen-reader users hear [object Object].

  1. Dashboard collection card, plus button: aria-label and title read Create new [object Object]. packages/ui/src/widgets/CollectionCards/index.tsx:109-111 calls t('general:createNewLabel', { label }) with the raw label, while the card title in the same file (:124) uses getTranslation(label, i18n).
  2. List view sort buttons: aria-label reads Sort by [object Object] Ascending / Descending. packages/ui/src/elements/SortColumn/index.tsx:54-57 and :65-68 call t('general:sortByLabelDirection', { direction, label }) with the raw field label (passed in from providers/TableColumns/buildColumnState).
  3. Document drawer toggler (the add-new button beside a relationship field): aria-label reads Add new [object Object]. packages/ui/src/elements/DocumentDrawer/index.tsx:48-50 calls t(operation === 'create' ? 'fields:addNewLabel' : 'general:editLabel', { label: collectionConfig?.labels.singular }); the edit branch has the same problem.

Expected: each accessible name contains the resolved label (Create new Posts, Sort by Title Ascending, Add new Post). A fix is to resolve with getTranslation(label, i18n) before the value reaches t() at the three sites.

Link to the code that reproduces this issue

https://github.com/masu1887/payload-3921-admin-labels-repro

Reproduction Steps

The repro is the blank layout with the Postgres adapter; posts has labels as { en, sv } records and a title field with label: { en: 'Title', sv: 'Titel' } in defaultColumns; comments has a relationship to posts. Start a Postgres 16, cp .env.example .env, pnpm install, pnpm dev, open http://localhost:3000/admin and create the first user.

  1. Dashboard /admin: inspect the plus link on the Posts card. aria-label="Create new [object Object]", title the same.
  2. /admin/collections/posts: inspect the two sort buttons in the Title column header. aria-label="Sort by [object Object] Ascending" and "Sort by [object Object] Descending".
  3. /admin/collections/comments/create: inspect the add-new button beside the post field. aria-label="Add new [object Object]".

Switch the admin language to Swedish (Account > Language): the same three read Skapa ny [object Object], Sortera efter [object Object] Stigande and Lägg till ny [object Object]. Observed in a running admin (Chromium) on 3.92.1.

Which area(s) are affected?

area: ui

Environment Info

Binaries:
  Node: 22.23.2
  pnpm: 11.7.0
Relevant Packages:
  payload: 3.92.1
  next: 16.3.3
  @payloadcms/db-postgres: 3.92.1
  @payloadcms/richtext-lexical: 3.92.1
  @payloadcms/translations: 3.92.1
  @payloadcms/ui/shared: 3.92.1
  react: 19.2.1
  react-dom: 19.2.1
Operating System:
  Platform: linux
  Arch: x64

Activity

  1. added
    area: ui
    on Oct 29, 2026
  2. added
    area: ui
    and removed
    area: ui
    on Oct 30, 2026
  3. github-actions commented on Nov 4, 2026

    @github-actions
    Contributor

    🚀 This is included in version v3.93.0

  4. self-assigned this
    on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

BugPayload OSSarea: ui

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions