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