How to make intl work ?
How to make intl work ?
micheld88
Posts: 12Questions: 3Answers: 0
Hi !
I'am using DataTables 1.10.5 and I try to make the language example work but it doesn't.
here is my code:
<pre>
<code class="multiline">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="generator" content="PSPad editor, www.pspad.com">
<title></title>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.12/css/jquery.dataTables.min.css">
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.3.min.js">
</script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js">
</script>
<script type="text/javascript" class="init">
$(document).ready(function() {
$('#example').DataTable( {
"oLanguage": {"sUrl": "i18n/dataTables.french.lang" },
} );
} );
</script>
</head>
<body>
<table id="example" class="display" cellspacing="0" width="100%">
... idem Datatables example from https://datatables.net/examples/basic_init/language.html
</table>
</body>
</html>
</code>
</pre>
where
dataTables.french.lang is
<pre>
<code class="multiline">
/**
* French translation
* @name French
* @anchor French
* @author
*/
{
"sProcessing": "Traitement en cours...",
"sSearch": "Rechercher :",
"sLengthMenu": "Afficher _MENU_ éléments",
"sInfo": "Affichage de l'élément _START_ à _END_ sur _TOTAL_ éléments",
"sInfoEmpty": "Affichage de l'élément 0 à 0 sur 0 élément",
"sInfoFiltered": "(filtré de _MAX_ éléments au total)",
"sInfoPostFix": "",
"sLoadingRecords": "Chargement en cours...",
"sZeroRecords": "Aucun élément à afficher",
"sEmptyTable": "Aucune donnée disponible dans le tableau",
"oPaginate": {
"sFirst": "Premier",
"sPrevious": "Précédent",
"sNext": "Suivant",
"sLast": "Dernier"
},
"oAria": {
"sSortAscending": ": activer pour trier la colonne par ordre croissant",
"sSortDescending": ": activer pour trier la colonne par ordre décroissant"
}
}
</code>
</pre>
What is wrong ?
Thanks,
Michel.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Remove the Javascript comment from the top of the language file. That makes it invalid JSON.
Use this file or copy the contents into your own local copy.
Allan
Thanks Allan !
Removing the comments do the trick.
Michel.