Editor labels in Datatables Field not translated

Editor labels in Datatables Field not translated

resqonlineresqonline Posts: 58Questions: 14Answers: 0

When I use the regular new, edit and delete buttons with an editor inside a datatables field, the labels only appear in English, although I generally use German translations. How can these strings be added to the translation file?

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    You need a buttons.create parameter in the language file you are loading - e.g.:

    {
      "buttons": {
        "create": "Nouveau",
        "edit": "Editer",
        "remove": "Supprimer"
      }
    }
    

    Looks like those are missing from the translation files - I'll take a look into that. But if you add those there parameters to your file, that should do the job.

    Allan

  • resqonlineresqonline Posts: 58Questions: 14Answers: 0

    Thanks @allan, the Editor buttons are in an extra array like this:

    "editor": {
        "close": "Schließen",
        "create": {
            "button": "Neu",
            "title": "Neuen Eintrag erstellen",
            "submit": "Neu"
        },
        "edit": {
            "button": "Ändern",
            "title": "Eintrag ändern",
            "submit": "ändern"
        },
        "remove": {
            "button": "Löschen",
            "title": "Löschen",
            "submit": "Löschen",
            "confirm": {
                "_": "Sollen %d Zeilen gelöscht werden?",
                "1": "Soll diese Zeile gelöscht werden?"
            }
        },
        "error": {
            "system": "Ein Systemfehler ist aufgetreten"
        },
        "multi": {
            "title": "Mehrere Werte",
            "info": "Die ausgewählten Elemente enthalten mehrere Werte für dieses Feld. Um alle Elemente für dieses Feld zu bearbeiten und auf denselben Wert zu setzen, klicken oder tippen Sie hier, andernfalls behalten diese ihre individuellen Werte bei.",
            "restore": "Änderungen zurücksetzen",
            "noMulti": "Dieses Feld kann nur einzeln bearbeitet werden, nicht als Teil einer Mengen-Änderung."
        }
    }
    

    Adding it to the buttons array doesn't seem to be doing the trick, though...

  • resqonlineresqonline Posts: 58Questions: 14Answers: 0

    @allan I've checked my translation file and updated it. However most of the strings even in datatables (like "previous"/"next" and so on) don't seem to care that they are translated.
    When inspecting the ajax response from the german json file (downloaded from the available translation files), I get the following error message: SyntaxError: JSON.parse: expected double-quoted property name at line 55 column 5 of the JSON data
    Not sure what that means, as all strings are double-quoted :|
    I guess that's the reason the translation isn't loaded correctly when viewing the table etc.?

Sign In or Register to comment.