1 |
// DATA_TEMPLATE: dom_data |
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 |
var oSettings = oTable.fnSettings(); |
12 |
|
13 |
oTest.fnTest( |
14 |
"sUrl is blank by default", |
15 |
null, |
16 |
function () { return oSettings.oLanguage.sUrl == ""; } |
17 |
); |
18 |
|
19 |
|
20 |
oTest.fnWaitTest( |
21 |
"Loading of German file loads language information", |
22 |
function () { |
23 |
oSession.fnRestore(); |
24 |
oTable = $('#example').dataTable( { |
25 |
"oLanguage": { |
26 |
"sUrl": "../../../examples/examples_support/de_DE.txt" |
27 |
} |
28 |
} ); |
29 |
oSettings = oTable.fnSettings(); |
30 |
}, |
31 |
function () { |
32 |
var bReturn = |
33 |
oSettings.oLanguage.sProcessing == "Bitte warten..." && |
34 |
oSettings.oLanguage.sLengthMenu == "_MENU_ Einträge anzeigen" && |
35 |
oSettings.oLanguage.sZeroRecords == "Keine Einträge vorhanden." && |
36 |
oSettings.oLanguage.sInfo == "_START_ bis _END_ von _TOTAL_ Einträgen" && |
37 |
oSettings.oLanguage.sInfoEmpty == "0 bis 0 von 0 Einträgen" && |
38 |
oSettings.oLanguage.sInfoFiltered == "(gefiltert von _MAX_ Einträgen)" && |
39 |
oSettings.oLanguage.sInfoPostFix == "" && |
40 |
oSettings.oLanguage.sSearch == "Suchen" && |
41 |
oSettings.oLanguage.oPaginate.sFirst == "Erster" && |
42 |
oSettings.oLanguage.oPaginate.sPrevious == "Zurück" && |
43 |
oSettings.oLanguage.oPaginate.sNext == "Nächster" && |
44 |
oSettings.oLanguage.oPaginate.sLast == "Letzter"; |
45 |
|
46 |
return bReturn; |
47 |
} |
48 |
); |
49 |
|
50 |
/* One DOM check just to ensure that they go into the DOM */ |
51 |
oTest.fnTest( |
52 |
"Loaded language goes into the DOM", |
53 |
null, |
54 |
function () { return document.getElementById('example_info').innerHTML = "1 bis 10 von 57 Einträgen"; } |
55 |
); |
56 |
|
57 |
|
58 |
oTest.fnComplete(); |
59 |
} ); |