l-lin / angular-datatables

DataTables with Angular
https://l-lin.github.io/angular-datatables/
MIT License
1.58k stars 487 forks source link

language in angular6 #1304

Closed lammh closed 6 years ago

lammh commented 6 years ago

I need to change language of datatables in French this.dtOptions = { ajax: 'data/get_villes.php', columns: [{ title: 'ID', data: 'villeId' }, { title: 'Nom ville', data: 'villeTitle', } , { title: 'act', data: 'act', class: 'none' }],

  dom: 'Bfrtip',
  // Configure the buttons

  // Use this attribute to enable the responsive extension
  responsive: true,
  select: true,
 language: [{

    Processing:     "Traitement en cours...",
    Search:         'Rechercher :',
    LengthMenu:     "Afficher _MENU_ éléments",
    Info:           "Affichage de l'élément _START_ à _END_ sur _TOTAL_ éléments",
    InfoEmpty:      "Affichage de l'élément 0 à 0 sur 0 élément",
    InfoFiltered:   "(filtré de _MAX_ éléments au total)",

    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"
    }
}],
  buttons: [

      {
          extend: 'collection',
          text: 'Export',
          buttons: [
              'copy',
              'excel',
              'csv',
              'pdf',
              'print'
          ]
      }
  ]

} }; image nothing changes

Environment


- node version: 
- angular version:6.1.5
- angular-cli version:6.1.5
- jquery version:3.3.1
- datatables version:.10.19
- angular-datatables version: 6.0.0
alicanuslu commented 6 years ago

it works like this.

this.dtOptions = { "language": { "url": "//cdn.datatables.net/plug-ins/9dcbecd42ad/i18n/Turkish.json" }, "bLengthChange": false, pageLength: 5, responsive: true, columnDefs: [ { type: 'turkish', targets: '_all' } ], "initComplete": function (settings, json) { $('table').show(); } };

lammh commented 6 years ago

Sorry not work for me

lammh commented 6 years ago

thank's it's working now

cams1990 commented 5 years ago

est ce que je peux savoir le nom du fichier ou on doit insérer ce code