DataTables / TableTools

Please note that TableTools has now been retired and replaced by the Buttons and Select extensions which offers significant improvements and API integration with the rest of DataTables and the other extensions.
http://datatables.net/
Other
237 stars 149 forks source link

Add support for oLanguage defaults in TableTools #61

Closed alesnav closed 9 years ago

alesnav commented 9 years ago

Hello,

I know this is a common question in the forums, so it would be nice to track this through GitHub. As you said, TableTools will be enhanced in version 3.0, and I think this feature should be included in it.

DataTables has a roadmap published (http://www.datatables.net/development/roadmap), but there is no one for TableTools, so we don't know if you marked this to do it in the future.

Maybe you have already started to develop the new version, because you said this would be done after DataTables 1.10 (1.10.2 now) and Editor 1.3 (1.3.3 now) were published.

Thanks Allan!

DataTables commented 9 years ago

I don't think its that common - I don't immediately remember it, but then there are >21k threads in the forum now! What language options would you like to have loaded via Ajax? The button titles and the dialogue options I guess? It isn't something I'm working on yet, but I will look into it when I start work on the next major update to TableTools.

alesnav commented 9 years ago

Well, you know, it is easy to find it on Google just searching by TableTools oLanguage, so I don`t create a new thread if there is one talking about it.

I think that the best way to load its defaults would be using the main DataTables language file, as commented by joelones in http://datatables.net/forums/discussion/19941/change-language-for-tabletools-buttons.

For example, adding option sToolTip for all buttons (already exists for print button) and sInfo for copybutton:

{
    "sEmptyTable":     "No data available in table",
    "sInfo":           "Showing _START_ to _END_ of _TOTAL_ entries",
    "sInfoEmpty":      "Showing 0 to 0 of 0 entries",
    "sInfoFiltered":   "(filtered from _MAX_ total entries)",
    "sInfoPostFix":    "",
    "sInfoThousands":  ",",
    "sLengthMenu":     "Show _MENU_ entries",
    "sLoadingRecords": "Loading...",
    "sProcessing":     "Processing...",
    "sSearch":         "Search:",
    "sZeroRecords":    "No matching records found",
    "oPaginate": {
        "sFirst":    "First",
        "sLast":     "Last",
        "sNext":     "Next",
        "sPrevious": "Previous"
    },
    "oAria": {
        "sSortAscending":  ": activate to sort column ascending",
        "sSortDescending": ": activate to sort column descending"
    },
    "TableTools": {
        "csv": {
            "sButtonText": "CSV",
            "sToolTip": "Save table as CSV"
        },
        "xls": {
            "sButtonText": "Excel",
            "sToolTip": "Save table for Excel"
        },
        "copy": {
            "sButtonText": "Copy",
            "sToolTip": "Copy table to the clipboard",
            "sInfo": "<h6>Table copied</h6><p>Table copied to the clipboard.</p>"
        },
        "pdf": {
            "sButtonText": "PDF",
            "sToolTip": "Save table as PDF"
        },
        "print": {
            "sButtonText": "Print",
            "sInfo": "<h6>Print view</h6><p>Please use your browser's print function to print this table. Press escape when finished.</p>",
            "sToolTip": "View print view"
        },
        "select": {
            "sButtonText": "Select button",
            "sToolTip": ""
        },
        "select_single": {
            "sButtonText": "Select button",
            "sToolTip": ""
        },
        "select_all": {
            "sButtonText": "Select all",
            "sToolTip": ""
        },
        "select_none": {
            "sButtonText": "Deselect all",
            "sToolTip": ""
        },
        "ajax": {
            "sButtonText": "Ajax button",
            "sToolTip": ""
        },
        "collection": {
            "sButtonText": "Collection",
            "sToolTip": ""
        }
    }
}
DataTables commented 9 years ago

Yup - sounds like a good idea and thanks for the link. I'll look into this when I start development of the next major version of TableTools.

DataTables commented 9 years ago

Going to close this in favour of the generic bug DataTables/DataTables #422