Translation + CreatedRow does not work

Translation + CreatedRow does not work

Hello

I am a newbie and I do not understand why only one function or parameter is working but not together.


Working:

  1.    
    $(document).ready(function() {
         $('#patients').dataTable( {
     
             "createdRow": function ( row, data, index ) {
                 if ( data[2] == "Désactivé(e)" ) {
                     $(row).addClass('highlight');
                 }
             }      
     
         } );
    } );

Working:
  1.    
    $(document).ready(function() {
         $('#patients').dataTable( {
     
             language: {
                 processing:     "Traitement en cours...",
                 search:         "Rechercher :",
                 lengthMenu:     "Afficher _MENU_ éléments",
                 info:           "Affichage de l'élement _START_ à _END_ sur _TOTAL_ éléments",
                 infoEmpty:      "Affichage de l'élement 0 à 0 sur 0 éléments",
                 infoFiltered:   "(filtré de _MAX_ éléments au total)",
                 infoPostFix:    "",
                 loadingRecords: "Chargement en cours...",
                 zeroRecords:    "Aucun élément à afficher",
                 emptyTable:     "Aucune donnée disponible dans le tableau",
                 paginate: {
                     first:      "Premier",
                     previous:   "Précédent",
                     next:       "Suivant",
                     last:       "Dernier"
                 },
                 aria: {
                     sortAscending:  ": activer pour trier la colonne par ordre croissant",
                     sortDescending: ": activer pour trier la colonne par ordre décroissant"
                 }
             }
     
         } );
    } );

Not working:
  1.    
    $(document).ready(function() {
         $('#patients').dataTable( {
     
         "createdRow": function ( row, data, index ) {
             if ( data[2] == "Désactivé(e)" ) {
                 $(row).addClass('highlight');
              }
             }
     
         language: {
     
                 processing:     "Traitement en cours...",
                 search:         "Rechercher :",
                 lengthMenu:     "Afficher _MENU_ éléments",
                 info:           "Affichage de l'élement _START_ à _END_ sur _TOTAL_ éléments",
                 infoEmpty:      "Affichage de l'élement 0 à 0 sur 0 éléments",
                 infoFiltered:   "(filtré de _MAX_ éléments au total)",
                 infoPostFix:    "",
                 loadingRecords: "Chargement en cours...",
                 zeroRecords:    "Aucun élément à afficher",
                 emptyTable:     "Aucune donnée disponible dans le tableau",
                 paginate: {
                     first:      "Premier",
                     previous:   "Précédent",
                     next:       "Suivant",
                     last:       "Dernier"
                 },
                 aria: {
                     sortAscending:  ": activer pour trier la colonne par ordre croissant",
                     sortDescending: ": activer pour trier la colonne par ordre décroissant"
                 }
             }
     
         } );
    } );

Not working:
  1.     $(document).ready(function() {
           
           
            $('#patients').dataTable( {
               
                "createdRow": function ( row, data, index ) {
                    if ( data[2] == "Désactivé(e)" ) {
                        $(row).addClass('highlight');
                    }
                }
            } );
                   
           
            $('#patients').dataTable.destroy();       
           
           
            $('#patients').dataTable( {
               
                language: {
                    processing:     "Traitement en cours...",
                    search:         "Rechercher :",
                    lengthMenu:    "Afficher _MENU_ éléments",
                    info:           "Affichage de l'élement _START_ à _END_ sur _TOTAL_ éléments",
                    infoEmpty:      "Affichage de l'élement 0 à 0 sur 0 éléments",
                    infoFiltered:   "(filtré de _MAX_ éléments au total)",
                    infoPostFix:    "",
                    loadingRecords: "Chargement en cours...",
                    zeroRecords:    "Aucun élément à afficher",
                    emptyTable:     "Aucune donnée disponible dans le tableau",
                    paginate: {
                        first:      "Premier",
                        previous:   "Précédent",
                        next:       "Suivant",
                        last:       "Dernier"
                    },
                    aria: {
                        sortAscending:  ": activer pour trier la colonne par ordre croissant",
                        sortDescending: ": activer pour trier la colonne par ordre décroissant"
                    }
                }
            } );
           
        } );