Skip to content

Commit 7e56d4c

Browse files
bpenaJLLeitschuh
authored andcommitted
add translate to i18n 'es' on pagination directive.
1 parent 47ebfb3 commit 7e56d4c

File tree

4 files changed

+32
-15
lines changed

4 files changed

+32
-15
lines changed

src/features/pagination/js/pagination.js

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,15 @@
131131

132132
grid.api.registerEventsFromObject(publicApi.events);
133133
grid.api.registerMethodsFromObject(publicApi.methods);
134-
134+
135135
var processPagination = function( renderableRows ){
136136
if (grid.options.useExternalPagination || !grid.options.enablePagination) {
137137
return renderableRows;
138138
}
139139
//client side pagination
140140
var pageSize = parseInt(grid.options.paginationPageSize, 10);
141141
var currentPage = parseInt(grid.options.paginationCurrentPage, 10);
142-
142+
143143
var visibleRows = renderableRows.filter(function (row) { return row.visible; });
144144
grid.options.totalItems = visibleRows.length;
145145

@@ -150,7 +150,7 @@
150150
}
151151
return visibleRows.slice(firstRow, firstRow + pageSize);
152152
};
153-
153+
154154
grid.registerRowsProcessor(processPagination, 900 );
155155

156156
},
@@ -214,7 +214,7 @@
214214
if (gridUtil.isNullOrUndefined(gridOptions.paginationPageSize)) {
215215
if (gridOptions.paginationPageSizes.length > 0) {
216216
gridOptions.paginationPageSize = gridOptions.paginationPageSizes[0];
217-
} else {
217+
} else {
218218
gridOptions.paginationPageSize = 0;
219219
}
220220
}
@@ -254,7 +254,7 @@
254254
}
255255
}
256256
};
257-
257+
258258
return service;
259259
}
260260
]);
@@ -343,20 +343,21 @@
343343
$scope.paginationApi = uiGridCtrl.grid.api.pagination;
344344
$scope.sizesLabel = i18nService.getSafeText('pagination.sizes');
345345
$scope.totalItemsLabel = i18nService.getSafeText('pagination.totalItems');
346-
346+
$scope.paginationOf = i18nService.getSafeText('pagination.of');
347+
347348
var options = uiGridCtrl.grid.options;
348-
349+
349350
uiGridCtrl.grid.renderContainers.body.registerViewportAdjuster(function (adjustment) {
350351
adjustment.height = adjustment.height - gridUtil.elementHeight($elm);
351352
return adjustment;
352353
});
353-
354+
354355
var dataChangeDereg = uiGridCtrl.grid.registerDataChangeCallback(function (grid) {
355356
if (!grid.options.useExternalPagination) {
356357
grid.options.totalItems = grid.rows.length;
357358
}
358359
}, [uiGridConstants.dataChange.ROW]);
359-
360+
360361
$scope.$on('$destroy', dataChangeDereg);
361362

362363
var setShowing = function () {
@@ -367,8 +368,8 @@
367368
var deregT = $scope.$watch('grid.options.totalItems + grid.options.paginationPageSize', setShowing);
368369

369370
var deregP = $scope.$watch('grid.options.paginationCurrentPage + grid.options.paginationPageSize', function (newValues, oldValues) {
370-
if (newValues === oldValues) {
371-
return;
371+
if (newValues === oldValues) {
372+
return;
372373
}
373374

374375
if (!angular.isNumber(options.paginationCurrentPage) || options.paginationCurrentPage < 1) {
@@ -398,15 +399,15 @@
398399
return options.data.length < 1;
399400
}
400401
};
401-
402+
402403
$scope.cantPageToLast = function () {
403404
if (options.totalItems > 0) {
404405
return $scope.cantPageForward();
405406
} else {
406407
return true;
407408
}
408409
};
409-
410+
410411
$scope.cantPageBackward = function () {
411412
return options.paginationCurrentPage <= 1;
412413
};

src/features/pagination/templates/pagination.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<div class="ui-grid-pager-count-container">
1717
<div class="ui-grid-pager-count">
1818
<span ng-show="grid.options.totalItems > 0">
19-
{{showingLow}} - {{showingHigh}} of {{grid.options.totalItems}} {{totalItemsLabel}}
19+
{{showingLow}} - {{showingHigh}} {{paginationOf}} {{grid.options.totalItems}} {{totalItemsLabel}}
2020
</span>
2121
</div>
2222
</div>

src/js/i18n/en.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@
6464
},
6565
pagination: {
6666
sizes: 'items per page',
67-
totalItems: 'items'
67+
totalItems: 'items',
68+
of: 'of'
6869
},
6970
grouping: {
7071
group: 'Group',

src/js/i18n/es.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,21 @@
5858
invalidCsv: 'No fue posible procesar el archivo, ¿es un CSV válido?',
5959
invalidJson: 'No fue posible procesar el archivo, ¿es un Json válido?',
6060
jsonNotArray: 'El archivo json importado debe contener un array, abortando.'
61+
},
62+
pagination: {
63+
sizes: 'registros por página',
64+
totalItems: 'registros',
65+
of: 'de'
66+
},
67+
grouping: {
68+
group: 'Agrupar',
69+
ungroup: 'Desagrupar',
70+
aggregate_count: 'Agr: Cont',
71+
aggregate_sum: 'Agr: Sum',
72+
aggregate_max: 'Agr: Máx',
73+
aggregate_min: 'Agr: Min',
74+
aggregate_avg: 'Agr: Prom',
75+
aggregate_remove: 'Agr: Quitar'
6176
}
6277
});
6378
return $delegate;

0 commit comments

Comments
 (0)