You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Estos archivos tienen una guia de como traducir el componente Mat-Paginator de Angular Material al español, pero pueden ser utilizados para traducir el componente a cualquier idioma. Solo piense un poco, no hace daño. 😎
constspanishRangeLabel=(page: number,pageSize: number,length: number): string=>{// Check data lengthif(length===0||pageSize===0){return`0 de ${length}`;}// Get max lengthlength=Math.max(length,0);// Set start indexconststartIndex=page*pageSize;// If the start index exceeds the list length, do not try and fix the end index to the end.constendIndex=startIndex<length ?
Math.min(startIndex+pageSize,length) :
startIndex+pageSize;// Return rangereturn`${startIndex+1} - ${endIndex} de ${length}`;};
Create function to translate
/** * Get translated paginator text * * @export */exportfunctiongetSpanishPaginatorIntl(): MatPaginatorIntl{// Create a new instance of MatPaginatorconstpaginatorIntl=newMatPaginatorIntl();// Text translation for each element in the paginatorpaginatorIntl.firstPageLabel='Primera página';paginatorIntl.itemsPerPageLabel='Elementos por página:';paginatorIntl.nextPageLabel='Página siguiente';paginatorIntl.previousPageLabel='Página anterior';paginatorIntl.lastPageLabel='Última página';paginatorIntl.getRangeLabel=spanishRangeLabel;// Return MatPaginator translatedreturnpaginatorIntl;}
Thanks my friend , its easy to implement , tooo easy .