1 |
// DATA_TEMPLATE: empty_table |
2 |
oTest.fnStart( "oLanguage.sUrl" ); |
3 |
|
4 |
/* Note that we only test the internal storage of language information pulled form a file here |
5 |
* as the other language tests will check it goes into the DOM correctly |
6 |
*/ |
7 |
|
8 |
$(document).ready( function () { |
9 |
/* Check the default */ |
10 |
var oTable = $('#example').dataTable( { |
11 |
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt" |
12 |
} ); |
13 |
var oSettings = oTable.fnSettings(); |
14 |
|
15 |
oTest.fnTest( |
16 |
"sUrl is blank by default", |
17 |
null, |
18 |
function () { return oSettings.oLanguage.sUrl == ""; } |
19 |
); |
20 |
|
21 |
|
22 |
oTest.fnWaitTest( |
23 |
"Loading of German file loads language information", |
24 |
function () { |
25 |
oSession.fnRestore(); |
26 |
oTable = $('#example').dataTable( { |
27 |
"sAjaxSource": "../../../examples/ajax/sources/arrays.txt", |
28 |
"oLanguage": { |
29 |
"sUrl": "../../../examples/examples_support/de_DE.txt" |
30 |
} |
31 |
} ); |
32 |
oSettings = oTable.fnSettings(); |
33 |
}, |
34 |
function () { |
35 |
var bReturn = |
36 |
oSettings.oLanguage.sProcessing == "Bitte warten..." && |
37 |
oSettings.oLanguage.sLengthMenu == "_MENU_ Einträge anzeigen" && |
38 |
oSettings.oLanguage.sZeroRecords == "Keine Einträge vorhanden." && |
39 |
oSettings.oLanguage.sInfo == "_START_ bis _END_ von _TOTAL_ Einträgen" && |
40 |
oSettings.oLanguage.sInfoEmpty == "0 bis 0 von 0 Einträgen" && |
41 |
oSettings.oLanguage.sInfoFiltered == "(gefiltert von _MAX_ Einträgen)" && |
42 |
oSettings.oLanguage.sInfoPostFix == "" && |
43 |
oSettings.oLanguage.sSearch == "Suchen" && |
44 |
oSettings.oLanguage.oPaginate.sFirst == "Erster" && |
45 |
oSettings.oLanguage.oPaginate.sPrevious == "Zurück" && |
46 |
oSettings.oLanguage.oPaginate.sNext == "Nächster" && |
47 |
oSettings.oLanguage.oPaginate.sLast == "Letzter"; |
48 |
|
49 |
return bReturn; |
50 |
} |
51 |
); |
52 |
|
53 |
/* One DOM check just to ensure that they go into the DOM */ |
54 |
oTest.fnTest( |
55 |
"Loaded language goes into the DOM", |
56 |
null, |
57 |
function () { return document.getElementById('example_info').innerHTML = "1 bis 10 von 57 Einträgen"; } |
58 |
); |
59 |
|
60 |
|
61 |
oTest.fnComplete(); |
62 |
} ); |