From bff18f0f76f72b78a11969cb26bb3e06e1fc1523 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Fri, 2 Sep 2011 14:43:41 +0200 Subject: [PATCH] DataTables: Add language defaults in datatables.js (for translation) --- koha-tmpl/intranet-tmpl/prog/en/js/datatables.js | 27 ++++++++++++++++++++++ koha-tmpl/opac-tmpl/prog/en/js/datatables.js | 27 ++++++++++++++++++++++ 2 files changed, 54 insertions(+), 0 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js index 75d698d..ec05b6a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js @@ -1,3 +1,30 @@ +// These default options are for translation but can be used +// for any other datatables settings +// To use it, write: +// $("#table_id").dataTable($.extend(true, {}, dataTableDefaults, { +// // other settings +// } ) ); +var dataTablesDefaults = { + "oLanguage": { + "oPaginate": { + "sFirst" : _("First"), + "sLast" : _("Last"), + "sNext" : _("Next"), + "sPrevious" : _("Previous") + }, + "sEmptyTable" : _("No data available in table"), + "sInfo" : _("Showing _START_ to _END_ of _TOTAL_ entries"), + "sInfoEmpty" : _("No entries to show"), + "sInfoFiltered" : _("(filtered from _MAX_ total entries"), + "sLengthMenu" : _("Show _MENU_ entries"), + "sLoadingRecords" : _("Loading..."), + "sProcessing" : _("Processing..."), + "sSearch" : _("Search:"), + "sZeroRecords" : _("No matching records found") + } +}; + + // Return an array of string containing the values of a particular column $.fn.dataTableExt.oApi.fnGetColumnData = function ( oSettings, iColumn, bUnique, bFiltered, bIgnoreEmpty ) { // check that we have a column id diff --git a/koha-tmpl/opac-tmpl/prog/en/js/datatables.js b/koha-tmpl/opac-tmpl/prog/en/js/datatables.js index 75d698d..cfd5d05 100644 --- a/koha-tmpl/opac-tmpl/prog/en/js/datatables.js +++ b/koha-tmpl/opac-tmpl/prog/en/js/datatables.js @@ -1,3 +1,30 @@ +// These default options are for translation but can be used +// for any other datatables settings +// To use it, write: +// $("#table_id").dataTable($.extend(true, {}, dataTableDefaults, { +// // other settings +// } ) ); +var dataTableDefaults = { + "oLanguage": { + "oPaginate": { + "sFirst" : _("First"), + "sLast" : _("Last"), + "sNext" : _("Next"), + "sPrevious" : _("Previous") + }, + "sEmptyTable" : _("No data available in table"), + "sInfo" : _("Showing _START_ to _END_ of _TOTAL_ entries"), + "sInfoEmpty" : _("No entries to show"), + "sInfoFiltered" : _("(filtered from _MAX_ total entries"), + "sLengthMenu" : _("Show _MENU_ entries"), + "sLoadingRecords" : _("Loading..."), + "sProcessing" : _("Processing..."), + "sSearch" : _("Search:"), + "sZeroRecords" : _("No matching records found") + } +}; + + // Return an array of string containing the values of a particular column $.fn.dataTableExt.oApi.fnGetColumnData = function ( oSettings, iColumn, bUnique, bFiltered, bIgnoreEmpty ) { // check that we have a column id -- 1.7.5.4