Skip to content

TablePaginator's ARIA labels default to English rather than the configured locale #157

Description

@woksin

What happens

TablePaginator's controls are icon-only, so their aria-label is their only accessible name, and the
defaults are English literals (dist/esm/DataTables/TablePaginator.js):

const labels = {
    navigation: 'Pagination',
    first: 'First page',
    previous: 'Previous page',
    next: 'Next page',
    last: 'Last page',
    ...ariaLabels,
};

Evidence

@cratis/components 3.4.0. ariaLabels on TablePaginatorProps, surfaced as paginatorAriaLabels on the
table wrappers (DataTableForQuery, DataTableForObservableQuery), accepts overrides — and we now pass them
from our own localized strings on both admin tables.

So our present cost is zero, and we are saying so rather than dressing this up. It is recorded for
completeness, not as a blocker.

What it costs a consumer

A consumer that does not know the prop exists ships an English screen-reader experience by default, in every
locale, with nothing reporting it. The prop is the fix; the default is the trap.

Suggested fix — the seam

Default these from PrimeReactProps.locale when one is configured, keeping ariaLabels as the explicit
override. Same shape as the ask for the column filter overlay's chrome, which has no prop at all.

What is explicitly not being asked for

Not asking for translations to ship in this package, and not asking for the ariaLabels prop to change — it is
the right escape hatch. Only that the default not be a hardcoded language when the application has already told
PrimeReact which locale it is in.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions