Okay
  Public Ticket #2726922
Translation
Closed

Comments

  • Jörg Hartgen started the conversation

    Hello there,

    is it possible to dynamically generate the Displayd Header of a column depending on the language of the logged in user?

    Please have a look at the attached screenshot. In this example the column name in mysql is "message" and the display name is "Nachricht".

    The column name in mysql will always be the same, but the displayd header of the column should change depending on the current users choice of language.

    If its not a built in function: Do you have any idea how to solve this?

    Is there a wordpress translation plugin that would solve this? I found out that WPML is not compatible with wpdatatables (last year). Which translation plugin do you recommend to solve this?

    Best regards

    Jorg

  • [deleted] replied

    Hi Jorg

    Thank you for reaching out to us. 

    Unfortunately it is not possible to have the table dynamically translate based on the users language, you would have to create a separate table for each new language you want to showcase the table on.

    The plugin can be translated using POEDIT or Loco Translate easily. I suggest installing Loco Translate since it's within WordPress and it has a simple UI.

    If you want to use POEDIT then please follow these instructions:

    1. Download wpdatatables from our TMS Store and save the wpdatatables.zip file on your computer.

    2. Unzip downloaded file.

    3. Download and install POEDIT

    4. After that, open the program and open the file from the extracted folder on your computer wpdatatables/languages/en_US/wpdatatables.po.

    5. Translate all the strings in your language.

    6. Save the file as the plugin suggests (the language code; for example wpdatatables-id_ID.po if your language is Indonesian) and it will generate a new wpdatatables-id_ID.mo file. You can find your language code here

    7. Go to wpdatatables/languages/ folder and create a new folder. Name it as the language code for your language (in our case, for Indonesian, it is id_ID) and then copy these two files called wpdatatables-id_ID.po and wpdatatables-id_ID.mo into it. Proceed with copying the whole folder id_ID back to your website in folder ../wp-content/plugins/wpdatatables/languages/.

    Of course, you will use language code for your language (we use Indonesian language, and its language code "id_ID" is just an example).

    When you finish that, it would be nice to send us the translation, so we can include it in our next major update so you don't have to copy this folder from the local machine on every update.

    Hope this helps.