Skip to content

nelson6e65/datatables.net-translations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DataTables Internationalization

License Bower GitHub commits

Description

Language files for DataTables jQuery Plugin, based on DataTables/Plugins, powered by Transifex Translation Platform.

Installing

Bower

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.

Manual

  • Download the latest release.
  • Unzip that download.
  • Rename the resulting folder to datatables.net-translations.
  • Then move this folder into your assets directory.

Usage

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'
    }
} );

Use as default for all tables

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"
    }
});

Contributing

Translate

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.