From b3ae34d7ad3dfc10227f5e5f95e5b2ca14a6dba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=87etin?= <69278826+cetincakiroglu@users.noreply.github.com> Date: Thu, 28 Dec 2023 13:46:20 +0300 Subject: [PATCH] Fixed #12684 --- src/app/components/paginator/paginator.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/components/paginator/paginator.ts b/src/app/components/paginator/paginator.ts index b3f39578822..69fb7ab092e 100755 --- a/src/app/components/paginator/paginator.ts +++ b/src/app/components/paginator/paginator.ts @@ -58,7 +58,8 @@ import { PaginatorState } from './paginator.interface'; *ngFor="let pageLink of pageLinks" class="p-paginator-page p-paginator-element p-link" [ngClass]="{ 'p-highlight': pageLink - 1 == getPage() }" - [attr.aria-label]="getAriaLabel('pageLabel')" + [attr.aria-label]="getPageAriaLabel(pageLink)" + [attr.aria-current]="pageLink - 1 == getPage() ? 'page' : undefined" (click)="onPageLinkClick($event, pageLink - 1)" pRipple > @@ -290,6 +291,10 @@ export class Paginator implements OnInit, AfterContentInit, OnChanges { return this.config.translation.aria ? this.config.translation.aria[labelType] : undefined; } + getPageAriaLabel(value) { + return this.config.translation.aria ? this.config.translation.aria.pageLabel.replace(/{page}/g, `Page ${value}`) : undefined; + } + getLocalization(digit: number) { const numerals = [...new Intl.NumberFormat(this.locale, { useGrouping: false }).format(9876543210)].reverse(); const index = new Map(numerals.map((d, i) => [i, d]));