Change the language of DataTables and Editor

Change the language of DataTables and Editor

soportebcntekartsoportebcntekart Posts: 4Questions: 0Answers: 0
edited November 2012 in General
Hi I want to know how I can change the language of the Spanish and the steps that I have to, I've been taking a look at the translations section but do not know how I can do. Thank´s!

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    DataTables:
    Direction initialisation: http://datatables.net/release-datatables/examples/basic_init/language.html
    Reading from Ajax file: http://datatables.net/release-datatables/examples/advanced_init/language_file.html

    Spanish translation:
    http://datatables.net/plug-ins/i18n#Spanish

    Editor:
    Direction initialisation: http://editor.datatables.net/release/DataTables/extras/Editor/examples/i18n.html

    There isn't a translation for Editor available at the moment. If you would like to create one and share with everyone else, that would be most warmly welcomed.

    Allan
  • soportebcntekartsoportebcntekart Posts: 4Questions: 0Answers: 0
    But I do with all that? That's what I have to do? What steps I have to take? Thanks
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    The code is all there in the examples - look down the page a little. You just need to set the initialisation variables as shown in the examples.
  • hasenumberonehasenumberone Posts: 14Questions: 1Answers: 0
    For me the i18n-option doesn't work.

    [code]
    (function($){

    $(document).ready(function() {
    var editor = new $.fn.dataTable.Editor( {
    "ajaxUrl": "../_site/editor/php/table.adminix_gallery_fotos.php",
    "domTable": "#adminix_gallery_fotos",
    "rowHeight": "20px",
    "fields": [
    {
    "label": "Titel",
    "name": "title",
    "type": "text"
    },
    {
    "label": "Datei",
    "name": "filename",
    "type": "readonly"
    },
    {
    "label": "Beschreibung",
    "name": "description",
    "type": "textarea"
    },
    {
    "label": "Seite",
    "name": "pageID",
    "type": "select",
    "ipOpts": [
    { "label": "..Develop", "value": "1" }
    ]
    },
    {
    "label": "Sortierung",
    "name": "orderID",
    "type": "text"
    }
    ],
    "i18n": {
    "create": {
    "button": "Nouveau",
    "title": "Créer nouvelle entrée",
    "submit": "Créer"
    },
    "edit": {
    "button": "Modifier",
    "title": "Modifier entrée",
    "submit": "Actualiser"
    },
    "remove": {
    "button": "Supprimer",
    "title": "Supprimer",
    "submit": "Supprimer",
    "confirm": {
    "_": "Etes-vous sûr de vouloir supprimer %d lignes?",
    "1": "Etes-vous sûr de vouloir supprimer 1 ligne?"
    }
    },
    "error": {
    "system": "Une erreur s’est produite, contacter l’administrateur système"
    }
    }
    } );
    [/code]

    Is there something missing? It displays the english texts.
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Can you link to a page showing the error please? That looks like it should work correctly to me. Also what version of Editor are you using?

    Allan
  • hasenumberonehasenumberone Posts: 14Questions: 1Answers: 0
    Sorry, it is a closed local system. The editor is Version: 1.2.3.

    There are no error messages.
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    I'm afraid I don't really know what to suggest then, as it works for me if I copy and paste your code into my own local test cases.

    Allan
This discussion has been closed.