Internationalisation problem
Internationalisation problem
miroko
Posts: 8Questions: 0Answers: 0
I have trouble translating datatables's text from a language file, using dataTables 1.9.1
This code works as expexted (dattables texts comming up) :
[code]
innkurvTabell = jQuery('#tabell').dataTable ({
"aaData": JSONObjectArray,
"oLanguage":{
"oAria":{
"oSortAscending": " - klikk/tilbake til stigende sortering",
"oSortDecending": " - klikk/tilbake til synkende sortering"
},… rest of texts until ...
"sZeroRecords": "Ingen rader ble funnet"
},
"bJQueryUI":true,
"sPaginationType":"full_numbers"
});
[/code]
Same code using language file :
[code]
innkurvTabell = jQuery('#tabell').dataTable ({
"aaData": JSONObjectArray,
"oLanguage":{
"sUrl": "../js/jqDt/dataTables.norwegian.txt"
},
"bJQueryUI":true,
"sPaginationType":"full_numbers"
});
[/code]
The file dataTables.norwegian.txt is GET'ed correctly from the server, but table doesnt appear at all. No js error is shown in console.
dataTables.norwegian.txt look like this:
[code]
{
"oAria":{
"oSortAscending": " - klikk/tilbake til stigende sortering",
"oSortDecending": " - klikk/tilbake til synkende sortering"
},
"oPaginate": {
"sFirst": "Første side",
"sLast": "Siste side",
"sNext": "Neste side",
"sPrevious": "Forrige side"
},
"sEmptyTable": "Ingen rader ble funnet",
"sInfo": "Totalt _TOTAL_ rader (_START_ til _END_)",
"sInfoEmpty": "",
"sInfoFiltered": "- filtrert av _MAX_ rader",
"sLengthMenu": 'Vis ' + 'alle' + '5' +
'10' + '15' +
'20' + '50' + ' rader',
"sLoadingRecords": "Vennligst vent - henter data...",
"sProcessing": "Vennligst vent - tabellen oppdateres...",
"sSearch": "Filtrer data",
"sZeroRecords": "Ingen rader ble funnet",
"sUrl" : ""
}
[/code]
Why texts from dataTables.norwegian.txt crash a hole datatable ?
Regards miroko
This code works as expexted (dattables texts comming up) :
[code]
innkurvTabell = jQuery('#tabell').dataTable ({
"aaData": JSONObjectArray,
"oLanguage":{
"oAria":{
"oSortAscending": " - klikk/tilbake til stigende sortering",
"oSortDecending": " - klikk/tilbake til synkende sortering"
},… rest of texts until ...
"sZeroRecords": "Ingen rader ble funnet"
},
"bJQueryUI":true,
"sPaginationType":"full_numbers"
});
[/code]
Same code using language file :
[code]
innkurvTabell = jQuery('#tabell').dataTable ({
"aaData": JSONObjectArray,
"oLanguage":{
"sUrl": "../js/jqDt/dataTables.norwegian.txt"
},
"bJQueryUI":true,
"sPaginationType":"full_numbers"
});
[/code]
The file dataTables.norwegian.txt is GET'ed correctly from the server, but table doesnt appear at all. No js error is shown in console.
dataTables.norwegian.txt look like this:
[code]
{
"oAria":{
"oSortAscending": " - klikk/tilbake til stigende sortering",
"oSortDecending": " - klikk/tilbake til synkende sortering"
},
"oPaginate": {
"sFirst": "Første side",
"sLast": "Siste side",
"sNext": "Neste side",
"sPrevious": "Forrige side"
},
"sEmptyTable": "Ingen rader ble funnet",
"sInfo": "Totalt _TOTAL_ rader (_START_ til _END_)",
"sInfoEmpty": "",
"sInfoFiltered": "- filtrert av _MAX_ rader",
"sLengthMenu": 'Vis ' + 'alle' + '5' +
'10' + '15' +
'20' + '50' + ' rader',
"sLoadingRecords": "Vennligst vent - henter data...",
"sProcessing": "Vennligst vent - tabellen oppdateres...",
"sSearch": "Filtrer data",
"sZeroRecords": "Ingen rader ble funnet",
"sUrl" : ""
}
[/code]
Why texts from dataTables.norwegian.txt crash a hole datatable ?
Regards miroko
This discussion has been closed.
Replies
Allan