how to change language for DataTable

前端 未结 11 1746
灰色年华
灰色年华 2020-12-14 15:11

I store, in a session variable, which language does user wants to translate but I don\'t know to pass it DataTables

I found this explanation on the datatables websit

11条回答
  •  死守一世寂寞
    2020-12-14 15:56

    French translations:

    $('#my_table').DataTable({
      "language": {
        "sProcessing": "Traitement en cours ...",
        "sLengthMenu": "Afficher _MENU_ lignes",
        "sZeroRecords": "Aucun résultat trouvé",
        "sEmptyTable": "Aucune donnée disponible",
        "sInfo": "Lignes _START_ à _END_ sur _TOTAL_",
        "sInfoEmpty": "Aucune ligne affichée",
        "sInfoFiltered": "(Filtrer un maximum de_MAX_)",
        "sInfoPostFix": "",
        "sSearch": "Chercher:",
        "sUrl": "",
        "sInfoThousands": ",",
        "sLoadingRecords": "Chargement...",
        "oPaginate": {
          "sFirst": "Premier", "sLast": "Dernier", "sNext": "Suivant", "sPrevious": "Précédent"
        },
        "oAria": {
          "sSortAscending": ": Trier par ordre croissant", "sSortDescending": ": Trier par ordre décroissant"
        }
      }
    });
    

    });

提交回复
热议问题