@@ -219,6 +219,22 @@ <h3><code>DTOptionsBuilder</code></h3>
219
219
vm.dtOptions = DTOptionsBuilder.fromSource('data.json')
220
220
.withPaginationType('full_numbers');
221
221
}
222
+ </ div >
223
+ </ td >
224
+ </ tr >
225
+ < tr >
226
+ < td > < code > DTOptions</ code > </ td >
227
+ < td > < code > withLanguageSource(oLanguage)</ code > </ td >
228
+ < td >
229
+ < p > Set the language source of the datatables. If not defined, it uses the default language set by datables, ie english.</ p >
230
+ < p > You can find the list of languages in the < a href ="https://datatables.net/plug-ins/i18n/ "> DataTable official's documentation</ a > .</ p >
231
+ < div hljs language ="js ">
232
+ angular.module('myModule', ['datatables']).controller('MyCtrl', MyCtrl);
233
+ function MyCtrl(DTOptionsBuilder) {
234
+ var vm = this;
235
+ vm.dtOptions = DTOptionsBuilder.fromSource('data.json')
236
+ .withLanguageSource('/path/to/language');
237
+ }
222
238
</ div >
223
239
</ td >
224
240
</ tr >
@@ -233,7 +249,44 @@ <h3><code>DTOptionsBuilder</code></h3>
233
249
var vm = this;
234
250
vm.dtOptions = DTOptionsBuilder.fromSource('data.json')
235
251
.withLanguage({
236
- sUrl: '/path/to/language'
252
+ "sEmptyTable": "No data available in table",
253
+ "sInfo": "Showing _START_ to _END_ of _TOTAL_ entries",
254
+ "sInfoEmpty": "Showing 0 to 0 of 0 entries",
255
+ "sInfoFiltered": "(filtered from _MAX_ total entries)",
256
+ "sInfoPostFix": "",
257
+ "sInfoThousands": ",",
258
+ "sLengthMenu": "Show _MENU_ entries",
259
+ "sLoadingRecords": "Loading...",
260
+ "sProcessing": "Processing...",
261
+ "sSearch": "Search:",
262
+ "sZeroRecords": "No matching records found",
263
+ "oPaginate": {
264
+ "sFirst": "First",
265
+ "sLast": "Last",
266
+ "sNext": "Next",
267
+ "sPrevious": "Previous"
268
+ },
269
+ "oAria": {
270
+ "sSortAscending": ": activate to sort column ascending",
271
+ "sSortDescending": ": activate to sort column descending"
272
+ }
273
+ });
274
+ }
275
+ </ div >
276
+ < p >
277
+ It is not mandatory to specify every keywords. For example, if you just need to override the keywords
278
+ < code > oPaginate.sNext</ code > and < code > oPaginate.sPrevious</ code > :
279
+ </ p >
280
+ < div hljs language ="js ">
281
+ angular.module('myModule', ['datatables']).controller('MyCtrl', MyCtrl);
282
+ function MyCtrl(DTOptionsBuilder) {
283
+ var vm = this;
284
+ vm.dtOptions = DTOptionsBuilder.fromSource('data.json')
285
+ .withLanguage({
286
+ "oPaginate": {
287
+ "sNext": "»",
288
+ "sPrevious": "«"
289
+ }
237
290
});
238
291
}
239
292
</ div >
0 commit comments