I am using DataTables
styling from Datatables column filtering
. Right now I would like to have all the text changed to German instead of the default English. I found something from Datatables here: https://datatables.net/examples/advanced_init/language_file.html
I added it to my code below but it doesn't change the language to German. What could I be doing wrong?
$(document).ready(function() {
$(".se-pre-con").fadeOut("slow");
$('table thead tr').clone(true).appendTo( 'table thead' );
$('thead tr:eq(1) th').each( function (i) {
if(i > 4){
$(this).hide()
}
})
$('table').DataTable( {
"language": {
"url": "//cdn.datatables.net/plug-ins/9dcbecd42ad/i18n/German.json"
},
initComplete: function () {
this.api().columns().every( function () {
var column = this;
console.log(column.index())
var select = $('<select><option value=""></option></select>')
.appendTo( $(column.header()).empty() )
.on( 'change', function () {
var val = $.fn.dataTable.util.escapeRegex(
$(this).val()
);
column
.search( val ? '^'+val+'$' : '', true, false )
.draw();
} );
column.data().unique().sort().each( function ( d, j ) {
select.append( '<option value="'+d+'">'+d+'</option>' )
} );
} );
}
} );
} );