You can do it like this:
I’m providing you with croatian labels:
customClass.ts
import { Injectable } from '@angular/core';
import { MatPaginatorIntl } from '@angular/material/paginator';
@Injectable()
export class MatPaginatorIntlCro extends MatPaginatorIntl {
itemsPerPageLabel="Stavki po stranici";
nextPageLabel="Slijedeća stranica";
previousPageLabel="Prethodna stranica";
getRangeLabel = (page: number, pageSize: number, length: number) => {
if (length === 0 || pageSize === 0) {
return '0 od ' + length;
}
length = Math.max(length, 0);
const startIndex = page * pageSize;
// If the start index exceeds the list length, do not try and fix the end index to the end.
const endIndex = startIndex < length ?
Math.min(startIndex + pageSize, length) :
startIndex + pageSize;
return startIndex + 1 + ' - ' + endIndex + ' od ' + length;
};
}
and AppModule.ts:
providers: [{ provide: MatPaginatorIntl, useClass: MatPaginatorIntlCro}],