DataTable and internationalization

I’d like to change the language of the embedded objects (search, paging,…): I’ve tried to use the language object described at Internationalisation but I get only error messages … Does anybody know a way out? Thanks

How did you try to use the object?
What error(s) are you getting?

Providing a sample of the .nsx file maybe helpful👍🏻

You might also ask on the DataTables support page. This is a big and complicated library - the best support for it is probably there.

Hi! Basically I’m using the DataTable.nsx sample project where I call with a button the initlang function (analyzing the uncaught error I think that the reason is that you cannot rebuild the existing DataTable object, DataTable1 ).


function initlang() {
   $("#DataTable1").DataTable( {
      "language": {
           "search": "Filter"         
} );  


End JavaScript

From the DataTables forum I tried a solution … I attach the link to an example for the “search” embedded label (solution kindly suggested by Tester2017)

where YOUR_LABEL_TEXT is the translation of the search label and YOUR_TABLE_NAME is the name of the datatable in your code.

Unfortunately if you use it, the search box does not work any more

Thanks for posting what you have found so far!

From the DataTables forum I finally got a working solution (suggestion by rduncecb)

function changeSearchLabel(table, newLabel) {
    var input = $("#"+ table + "_filter > label > input").detach();
    $("#" + table + "_filter > label").html(newLabel).append(input);

where newLabel is the translation of the search label and table is the name of the datatable in your code

Tip: Surround your code by triple tics ``` and it will be formatted nicely!

(I did for you)