Internationalisation for Length Menu Inside Button

Internationalisation for Length Menu Inside Button

arnonrdparnonrdp Posts: 29Questions: 8Answers: 0

How do I translate a Length Menu inside a button?

This is what I tried to do:

$(document).ready(function () {
    var table = $('#ajaxTable').DataTable({
        dom: 'Bfrtip',
        lengthMenu: [
            [ 10, 25, 50, -1 ],
            [ '10 opções', '25 opções', '50 opções', 'Mostrar Todas' ]
            // directly translation here works pretty fine
        ],
        buttons: [
            'pageLength',
            {
                extend: 'collection',
                text: 'Baixar',
                buttons: [
                    'copy', 'csv', 'excel', 'pdf', 'print'
                ]
            }
        ],
        "language": {
            "sLengthMenu": "Mostrar _MENU_ opções", // tried this
            "buttons": {
                "sLengthMenu": "Mostrar _MENU_ opções", // and this
            }
        }
    });
});

I have already checked this: http://legacy.datatables.net/usage/i18n#oLanguage.sLengthMenu but it doesn't cover a Length Menu inside a button.

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.