Skip to content

Commit

Permalink
Fixed #12684
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed Dec 28, 2023
1 parent ebca8f0 commit b3ae34d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/app/components/paginator/paginator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
>
Expand Down Expand Up @@ -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]));
Expand Down

0 comments on commit b3ae34d

Please sign in to comment.