language.url

Since: DataTables 1.10

Load language information from remote file.

Deprecated!

As of v3.0.0 this feature has been deprecated. This feature has not yet been scheduled for removal, but its use is discouraged and the alternatives discussed below should be used.

As of DataTables 3 the language.ajax option is preferred over this option as it provides the same ability plus additional options. However, this option is still fully supported and will continue to be so.

Description

All of the language options DataTables provides can be stored in a file on the server, which DataTables will look up if this parameter is passed. The file must be a valid JSON file, and the object it contains has the same properties as the language object in the initialiser object (a subset of those properties is also valid).

As of DataTables 1.12, you can use a remote language file as well as local language options, and the local options will take priority.

There are a wide range of translations readily available on this site, in the internationalisation plug-ins.

Note that when this parameter is set, DataTables' initialisation will be asynchronous due to the Ajax data load. That is to say that the table will not be drawn until the Ajax request has completed. As such, any actions that require the table to have completed its initialisation should be placed into the initComplete callback.

Type

This option can be given in the following type(s):

Examples

Load language information from a remote file:

new DataTable('#myTable', {
	language: {
		url: '/dataTables/i18n/de_de.lang'
	}
});

Remote file and local string override:

new DataTable('#myTable', {
	language: {
		search: 'In der Tabelle finden',
		url: '/dataTables/i18n/de_de.lang'
	}
});

Related

The following options are directly related and may also be useful in your application development.