* Language compatibility - when certain options are given, and others aren't, we * need to duplicate the values over, in order to provide backwards compatibility * with older language files. * @param {object} oSettings dataTables settings object * @memberof DataTable#oApi
( lang )
| 372 | * @memberof DataTable#oApi |
| 373 | */ |
| 374 | function _fnLanguageCompat( lang ) |
| 375 | { |
| 376 | var defaults = DataTable.defaults.oLanguage; |
| 377 | var zeroRecords = lang.sZeroRecords; |
| 378 | |
| 379 | /* Backwards compatibility - if there is no sEmptyTable given, then use the same as |
| 380 | * sZeroRecords - assuming that is given. |
| 381 | */ |
| 382 | if ( ! lang.sEmptyTable && zeroRecords && |
| 383 | defaults.sEmptyTable === "No data available in table" ) |
| 384 | { |
| 385 | _fnMap( lang, lang, 'sZeroRecords', 'sEmptyTable' ); |
| 386 | } |
| 387 | |
| 388 | /* Likewise with loading records */ |
| 389 | if ( ! lang.sLoadingRecords && zeroRecords && |
| 390 | defaults.sLoadingRecords === "Loading..." ) |
| 391 | { |
| 392 | _fnMap( lang, lang, 'sZeroRecords', 'sLoadingRecords' ); |
| 393 | } |
| 394 | |
| 395 | // Old parameter name of the thousands separator mapped onto the new |
| 396 | if ( lang.sInfoThousands ) { |
| 397 | lang.sThousands = lang.sInfoThousands; |
| 398 | } |
| 399 | |
| 400 | var decimal = lang.sDecimal; |
| 401 | if ( decimal ) { |
| 402 | _addNumericSort( decimal ); |
| 403 | } |
| 404 | } |
| 405 | |
| 406 | |
| 407 | /** |
no test coverage detected