Translation: how to set french language in my calling script?
Translation: how to set french language in my calling script?
Track9890
Posts: 7Questions: 2Answers: 0
My script for calling Datatables is different from the one specified in official Datatables documentation. I am talking about tyhis one :
<script type="text/javascript">
new DataTable('#example', {
language: {
url: 'https://cdn.datatables.net/plug-ins/1.13.7/i18n/fr-FR.json'
}
});
</script>
I add to come with this one since it was not working.
<script type="text/javascript">
$(document).ready(function() {
$('#indexprix').DataTable({
"paging": false,
"ordering": true,
"info": false
});
});
</script>
How can I bring langage file calling into my calling script to make it french translated?
Answers
Combine all the configuration options into one Datatables initialization, like this:
Kevin
Like this?
Yes you might want to use document.ready() like you had before. Basically just add t
to the Datatables init code you already have.
Kevin
Also to note
new DataTable(selector, options)
is the same as$(selector).DataTable(options)
.I'm updating the documentation to focus on
new DataTable(...)
at the moment - but there is a lot of it!The two can be used interchangably.
Allan
This does work. Databable is not loading.
Seems to run okay if I copy and paste it into an example: https://live.datatables.net/tekixufe/1/edit .
Perhaps you can link to a page that is showing the issue so we can help you to debug it.
Allan