Topic: About Datatables language

IT free asked 4 years ago


Hi! Someone knows how to choose the language of MDBDataTable?


Piotr Glejzer staff answered 4 years ago


Hi,

Show entries you can change with entriesLabel | default: entriesLabel: 'Show entries'

Showing 1 to 5 of 57 entries you can change with
infoLabel: | default: infoLabel: ['Showing', 'to', 'of', 'entries']
another:
paginationLabel: ['Previous', 'Next']
searchLabel: 'Search'

We will add some more features in the next release. Check our packages on Monday and read a changelog! Have a nice day!


Best,
Piotr


Zantour Wael free commented 3 years ago

Hi , Please can u help me and tell me where did i can place this code for translation in my react js project i didn't know how i integrated .

Best, Wael


Krzysztof Wilk staff commented 3 years ago

Hi!

These customization options are component properties, so you have to use them while declaring a new MDBDatatable component :) You can read more about customization properties here, in API section (https://mdbootstrap.com/docs/react/tables/datatables/)

Keep coding!


jouvrard pro answered 4 years ago


You can configure this by usng some DataTable options.

Fore Example here is my translation to french:

$('.dataTables').DataTable({
    "language": {
        "sProcessing": "Traitement en cours...",
        "sSearch": "Rechercher :",
        "sLengthMenu": "Afficher _MENU_ éléments",
        "sInfo": "Affichage de l'élément _START_ à _END_ sur _TOTAL_ éléments",
        "sInfoEmpty": "Affichage de l'élément 0 à 0 sur 0 élément",
        "sInfoFiltered": "(filtré de _MAX_ éléments au total)",
        "sInfoPostFix": "",
        "sLoadingRecords": "Chargement en cours...",
        "sZeroRecords": "Aucun élément à afficher",
        "sEmptyTable": "Aucune donnée disponible dans le tableau",
        "oPaginate": {
            "sFirst": "Premier",
            "sPrevious": "Précédent",
            "sNext": "Suivant",
            "sLast": "Dernier"
        },
        "oAria": {
            "sSortAscending": ": activer pour trier la colonne par ordre croissant",
            "sSortDescending": ": activer pour trier la colonne par ordre décroissant"
        },
        "select": {
            "rows": {
                "_": "%d lignes sélectionnées",
                "0": "Aucune ligne sélectionnée",
                "1": "1 ligne sélectionnée"
            }
        }
    }
});

IT free commented 4 years ago

Sorry, but this solution doesnt help me, i cant modify the DOM because of React, thank you btw



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB React
  • MDB Version: 4.20.0
  • Device: PC
  • Browser: Mozilla
  • OS: Windows10
  • Provided sample code: No
  • Provided link: No