Skip to content

[ShadcnAdminUi] Pass %count% to the pagination results count translation - #419

Merged
loic425 merged 1 commit into
Sylius:mainfrom
loic425:fix/shadcn-pagination-count
Nov 25, 2026
Merged

loic425 merged 1 commit into
Sylius:mainfrom
loic425:fix/shadcn-pagination-count

Conversation

@loic425

@loic425 loic425 commented Nov 25, 2026

Copy link
Copy Markdown
Member

The ShadcnAdminUi grid footer shows both plural forms of the results count, e.g.:

Showing 1 to 10 of 20 entry|Showing 1 to 10 of 20 entries

sylius.ui.pagination.number_of_results is a singular|plural message, and Symfony's translator only picks a form when a %count% parameter is given. The Shadcn results_count macro passed only %from%, %to% and %total%. BootstrapAdminUi already passes %count% and renders correctly.

  • Pass '%count%': paginator.nbResults in @SyliusShadcnAdminUi/shared/helper/pagination.html.twig, like BootstrapAdminUi.
  • Add PaginationMacroTest, which renders the macro and checks both the plural and the singular form. It fails without the fix.
  • The en, fr, de and nl translations of this message all use the same %count%-based plural form, and no other Shadcn template is affected.

Example (test app, fr locale): before, Affichage de 11 à 20 sur 25 élément|Affichage de 11 à 20 sur 25 éléments; after, Affichage de 11 à 20 sur 25 éléments.

BC: none. The macro's signature is unchanged; only the rendered text is fixed.

@loic425 loic425 added the bug Something isn't working label Nov 25, 2026
@loic425
loic425 merged commit 25303b5 into Sylius:main Nov 25, 2026
36 checks passed
@loic425
loic425 deleted the fix/shadcn-pagination-count branch November 25, 2026 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants