19 lines
811 B
TypeScript
19 lines
811 B
TypeScript
import { Injectable } from '@angular/core';
|
||
import { MatPaginatorIntl } from '@angular/material/paginator';
|
||
|
||
/** Material's paginator speaks English by default; the whole app is in Spanish. */
|
||
@Injectable()
|
||
export class SpanishPaginatorIntl extends MatPaginatorIntl {
|
||
override itemsPerPageLabel = 'Filas por página';
|
||
override nextPageLabel = 'Página siguiente';
|
||
override previousPageLabel = 'Página anterior';
|
||
override firstPageLabel = 'Primera página';
|
||
override lastPageLabel = 'Última página';
|
||
override getRangeLabel = (page: number, pageSize: number, length: number): string => {
|
||
if (length === 0 || pageSize === 0) return `0 de ${length}`;
|
||
const start = page * pageSize;
|
||
const end = Math.min(start + pageSize, length);
|
||
return `${start + 1} – ${end} de ${length}`;
|
||
};
|
||
}
|