I can't seem to override the default language strings
I can't seem to override the default language strings
AdrianLC
Posts: 1Questions: 1Answers: 0
Hello,
I'm using django's javascript gettext for client side i18n. I'd rather not have two different i18n methods so I'm trying to
set up my translations as:
$.extend(true, $.fn.dataTable.defaults, {
oLanguage: {
sEmptyTable: gettext("No data available in table"),
sInfo: gettext("Showing _START_ to _END_ of _TOTAL_ entries"),
sInfoEmpty: gettext("Showing 0 to 0 of 0 entries"),
sInfoFiltered: gettext("(filtered from _MAX_ total entries)"),
sInfoPostFix: "",
sDecimal: get_format('DECIMAL_SEPARATOR'),
sThousands: get_format('THOUSAND_SEPARATOR'),
sLengthMenu: gettext("Show _MENU_ entries"),
sLoadingRecords: gettext("Loading..."),
sProcessing: gettext("Processing..."),
sSearch: gettext("Search:"),
sZeroRecords: gettext("No matching records found"),
oPaginate: {
sFirst: gettext("First"),
sLast: gettext("Last"),
sNext: gettext("Next"),
sPrevious: gettext("Previous")
},
oAria: {
sSortAscending: gettext(": activate to sort column ascending"),
sSortDescending: gettext(": activate to sort column descending")
},
sUrl: ""
}
});
The debugger shows that $.prototype.DataTable.defaults.oLanguage
has been updated as expected but when I initialize the table with zero configuration the translation does not work.
Thank you for taking the time to read this. Any help would be much appreciated.
This discussion has been closed.