Support » Plugin: WP DataTable » Loading a language file

  • Resolved 8oris

    (@8oris)


    Hello,

    Is there anyway to load a language file?

    I tried this way but it didn’t work. :/

    [wp-datatable id="table_webdoc" FAT="1"]
        dom: 'Bfrtip',
        paging: true,
        responsive: true,
        ordering: true,
        language: {"url": "dlweb-doc/wp-content/plugins/wp-datatable/French.lang"},
        buttons: [
            'copy', 'csv', 'colvis'
        ]
    [/wp-datatable]

    Thanks

    Cheers!

    8oris

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author samsk

    (@samsk)

    Hi,
    datatables languages files are not part of the plugin.
    You have 3 options, how to do it.
    1. provide your translated strings as a part of the [wp-datatable] configuration via language key ie. https://datatables.net/plug-ins/i18n/French
    I’m doing it this way, because this doesn’t requires additional http request.

    Example:

      [wp-datatable ...]
         language: {
            "search": "Rechercher",
            ....
         }
       [/wp-datatable]
    

    2. download language json from CDN, add it to media library and use its url. Translations are static, so they don’t need to be updated that often.

    3. use CDN url directly

    Thread Starter 8oris

    (@8oris)

    Thanks, i use the first option, it works perfectly! Thanks for your kind and faster-than-light answer! ^^

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Loading a language file’ is closed to new replies.