lengthMenu Internationalization
lengthMenu Internationalization
I'm using
$(document).ready( function () {
var table = $('#myTable1').DataTable({
language: {
url: '//cdn.datatables.net/plug-ins/2.3.6/i18n/de-DE.json',
},
lengthMenu: [15, 30, 100, -1],
buttons: ['copy', 'csv', 'pdf', 'print'],
dom: 'Blftrip',
});
} );
in some Joomla contend pages on a local WAMP server workinf fine.
After transfer to a hosted Joomla installation, the translation of the lengthMenu didn't work but the translation of the buttons is working fine.
I use as workaround
lengthMenu: [ [15, 30, 100, -1], [15, 30, 100, "Alle"] ],
but I'm not happy with this
This question has an accepted answers - jump to answer
Answers
I would start by making sure the downloaded
de-DE.jsonis correct ad has this in the file:json"lengthLabels": {"-1": "Alle"},Possibly an incorrect JSON file is being downloaded or a cached version is being used that is incorrect. Is it possible to link to a test case that shows the issue so we can help debug?
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
I'd also suggest checking what version the hosted install is using.
DataTable.versionon the console should tell you, or use the debugger.Allan
Thank you,
I made no changes, then checked the JSON, it was OK as expected. Removed the workaround, and, oh wonder, everything works fine as expected.