Language files for DataTables jQuery Plugin, based on DataTables/Plugins, powered by Transifex Translation Platform.
You can install translations for your project with Bower:
bower install --save datatables.net-translations
You can use a build tool, like Gulp to publish
locale
directory in your public directory, like other assets.
- Download the latest release.
- Unzip that download.
- Rename the resulting folder to
datatables.net-translations
. - Then move this folder into your assets directory.
Just follow instructions in DataTables manual.
Translations files named following ISO 639-1 code namming standard and using .json
extension.
So, for example, default Spanish language file is locale/es/default.json
.
That is the file you will use in the language.url
option:
$('#example').DataTable( {
language: {
url: '/assets/datatables.net-translations/locale/es/default.json'
}
} );
There is another alternative, using mostly icons, but requires Font Awesome. Usage:
$('#example').DataTable( {
language: {
url: '/assets/datatables.net-translations/locale/es/iconic.json'
}
} );
You can enable default language for all datatables by using DataTables global defaults on initialization:
$.extend(true, $.fn.dataTable.defaults, {
language: {
url: "/assets/datatables.net-translations/locale/es/default.json"
}
});
In order to translate this project, you should join the project in Transifex. More info in TRANSLATORS.md file.
Note: If you are not registered yet, you can easily register via GitHub.