Skip to content

Commit

Permalink
chore: init labels when constructing the paginator
Browse files Browse the repository at this point in the history
  • Loading branch information
QuCMGisaia committed Dec 17, 2024
1 parent 3b4b853 commit 9721c95
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion projects/arlas-toolkit/src/lib/tools/paginatori18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ export class PaginatorI18n implements MatPaginatorIntl {
public lastPageLabel: string;

public constructor(
private readonly translate: TranslateService) {
private translate: TranslateService
) {
this.changes = new Subject();
this.initLabels();
this.translate.onLangChange.subscribe({
next: () => {
this.initLabels();
Expand All @@ -46,6 +48,7 @@ export class PaginatorI18n implements MatPaginatorIntl {
this.previousPageLabel = this.translate.instant('PREVIOUS_PAGE_LABEL');
this.firstPageLabel = this.translate.instant('FIRST_PAGE_LABEL');
this.lastPageLabel = this.translate.instant('LAST_PAGE_LABEL');
this.changes.next();
}

public getRangeLabel(page: number, pageSize: number, length: number): string {
Expand Down

0 comments on commit 9721c95

Please sign in to comment.