Pagination: page button aria-labels are not translated on small screens
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- react, typescript
- Domain
- accessibility, frontend, internationalization
Research direction
Open packages/ra-ui-materialui/src/list/pagination/Pagination.tsx and compare the desktop branch, which already passes getItemAriaLabel={labelItem}, with the isSmall branch that renders the compact TablePagination. Add the same prop to the small branch, then run the pagination tests in that folder (e.g. Pagination.spec.tsx) and check that existing assertions on the small-screen rendering still pass. Done when the arrow buttons carry the translated ra.navigation.* labels at narrow widths, matching desktop.
Written by the indexing model from the issue text.
Description
What you were expecting:
On every screen size, the pagination buttons ("first", "previous", "next", "last") use the translated ra.navigation.* labels, as they do on desktop.
What happened instead:
Below the md breakpoint, <Pagination> renders the compact TablePagination without getItemAriaLabel, so MUI's English defaults are used ("Go to next page", "Go to previous page") whatever the locale. Screen reader users get English labels in a French or Spanish app.
Steps to reproduce:
- Open the demo https://marmelab.com/react-admin-demo/ and sign in (demo / demo).
- Switch the language to French with the app bar menu.
- Open the Reviews list on a wide screen and inspect the "next page" arrow button:
aria-label="Aller à la prochaine page". - Switch to a phone width (e.g. 360 px, device toolbar) and reload, then inspect the "next page" arrow next to "1-25 sur 320":
aria-label="Go to next page". The visible "1-25 sur 320" text is translated; only the arrow buttons' aria-labels (read by screen readers) are not.
Related code:
packages/ra-ui-materialui/src/list/pagination/Pagination.tsx: the desktop branch passes getItemAriaLabel={labelItem}, the isSmall branch does not. Adding the same prop to the small TablePagination fixes it:
<TablePagination
...
labelDisplayedRows={labelDisplayedRows}
getItemAriaLabel={labelItem}
slotProps={slotProps}
{...sanitizeListRestProps(rest)}
/>
Other information:
Workaround: add MUI's locale (frFR, esES… from @mui/material/locale) to the theme.
Environment
- React-admin version: 5.15.5 (still the same on master)
- React version: 18.3.1
- Browser: Chrome and Safari (WebKit)
- Dominant language
- TypeScript
- Stars
- 27k
- Forks
- 5.5k
- Avg merge
- 1d 3m
- Merged PRs (30d)
- 32
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from marmelab/react-admin
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
marmelab/react-admin#11431 ·
Maintainers usually reply within 1 day
-
Add emptyText property to SelectArrayInputPossibly taken @kwitykwity claimed this 60 days ago. Openenhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
marmelab/react-admin#10454 · 7 comments ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 Over a week Newbie friendliness 38/100
marmelab/react-admin#11426 · 1 reaction ·
Maintainers usually reply within 1 day
-
ra-data-graphql-simple: outdated graphql-ast-types-browser dependency causes npm peer warningsMay be free again @bipul724 claimed this 13 days ago, and no pull request is open. Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
marmelab/react-admin#11395 · 1 comment ·
Maintainers usually reply within 1 day
-
Fix decode-uri-component DoS (CVE-2026-45822) by dropping query-stringMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 3/5 1-2 days Newbie friendliness 68/100
marmelab/react-admin#11380 · 1 comment ·
Maintainers usually reply within 1 day
All issues in marmelab/react-admin
Similar issues
-
bug triage
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
hemi-earn
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
vetro-protocol/vetro-monorepo#1043 ·
Maintainers usually reply within 1 day
-
stage 2: bare names resolve against PATH differently from the shell (empty and relative entries)Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
STRML/omp-classifier#206 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
atlassian-labs/mermaid-diagrams-viewer#188 ·
Maintainers usually reply within 1 day
-
dashboard enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Olanetsoft/agent-lookout#225 ·
Maintainers usually reply within 1 day