Default translated without setting language each time

Default translated without setting language each time

postitiefpostitief Posts: 22Questions: 9Answers: 0

Hello,

I'm aware of the internationalisation plugin of DataTables. But is it also possible to default translate all DataTables for my project without setting the language for each created DataTable? So set the translation once for all the DataTables that will come up.

Thanks in advance.

This question has an accepted answers - jump to answer

Answers

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    Answer ✓
  • postitiefpostitief Posts: 22Questions: 9Answers: 0

    Nice, thanks! I knew it would be possible, but didn't know this feature jet!

    So my default init looks like this:

    var ROOT_URL = window.location.protocol +"//" + window.location.host;
    
    $.extend( $.fn.dataTable.defaults, {
      "language": {
        "url": ROOT_URL + "/static/misc/dataTables.dutch.lang"
      }
    });
    
This discussion has been closed.