French translation plugin has caused my spinner to stop working

French translation plugin has caused my spinner to stop working

imacoolguyfulimacoolguyful Posts: 17Questions: 5Answers: 0
edited February 2021 in Free community support
"language": {
                    processing: '<i class="fa fa-spinner fa-spin fa-3x fa-fw"></i><span class="sr-only">Loading..n.</span> ',
                    "url": "//cdn.datatables.net/plug-ins/1.10.22/i18n/French.json"
                },

Basically, after adding the french translation for the table it seems to override the processing icon that I added. I was wondering if there is a way to bypass this so that the table is still in french and I can see the processing icon. At the moment it has replaced the icon with the text "Traitement...".

If you need me to clarify anything else, just let me know. I appreciate the help.

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,174Questions: 26Answers: 4,923
    Answer ✓

    The JSON file has this: "sProcessing": "Traitement...",. I would copy the file local to your server and edit this option to show your spinner. Then load it from the local resource instead of the CDN.

    Or you could just copy the JSON contents into your Datatables init code and update as needed.

    Kevin

  • imacoolguyfulimacoolguyful Posts: 17Questions: 5Answers: 0

    thanks that helps a lot!

  • imacoolguyfulimacoolguyful Posts: 17Questions: 5Answers: 0

    @kthorngren Sorry, I just had one more question. This might be a little silly but how do I import the script now saved on my directory? My file is located in /static/json/French.json, do I use a src?

     "language": {
                        processing: '<i class="fa fa-spinner fa-spin fa-3x fa-fw"></i><span class="sr-only">Loading..n.</span> ',
                        "src": "/static/json/French.json"
                    },
    
  • kthorngrenkthorngren Posts: 21,174Questions: 26Answers: 4,923

    Use your browser's network inspector tool to see the request and response for /static/json/French.json. If the response has the JSON in it should work the same as pulling from the CDN.

    Kevin

This discussion has been closed.