• Resolved Joris

    (@jorisdw13)


    Hello,

    I’m trying to load in the translations for the datatable elements (no search results text to be precise). But these only seem to display the english version.

    I tried added the datatables_locale in the shortcode but it doesn’t seem to do anything.

    Also checked my /i18n/datatables folder and checked it with a latest download from this plugin and nothing seems out of order there.

    Not sure if this might affect anything but I’m using Polylang and use the same table ID across the different languages.

    Perhaps have any idea how I can get this resolved?


    Thank you

    • This topic was modified 1 year, 4 months ago by Joris.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi!

    Thanks for your post and sorry for the trouble!

    Can you please post a link to the page with the table where this problem happens, so that I can take a direct look? Thanks!

    Note that translating via Polylang will not work. Instead, you could try the approach from https://tablepress.org/extensions/change-datatables-strings/ if you want different texts.

    However, your approach of using datatables_locale should already lead do a different translation file being used. What exact Shortcodes are you using?

    Regards,
    Tobias

    Thread Starter Joris

    (@jorisdw13)

    Hi Tobias,

    Thank you for your time.
    at the moment i’m just testing to see if i can force the other language. with following shortcode

    [table id=27 datatables_locale=es_ES /]

    I’m using it on the following page.
    *removed the url*

    • This reply was modified 1 year, 4 months ago by Joris.
    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for the link! So, that Shortcode is working, an the es_ES translations are loaded – but they are immediately being overwritten by the “Custom Command”

    "language": {
     "search": "<span class='catit-wtb__label'>Search by location, ZIP, or store name</span>",
     "searchPlaceholder": "Search by location, ZIP, or store name",
     }

    that you have added on the “Edit” screen of this table 27.

    So, once you remove that (and instead change these strings in the PHP or JSON file via the mentioned TablePress Extensions), everything should work fine here.

    Best wishes,
    Tobias

    Thread Starter Joris

    (@jorisdw13)

    Hi Tobias,

    Is there a way for me to create custom translations to the ones I made in the custom command?

    And limit these only to a certain set of tables so this doesn’t apply to all of them?

    Thanks for your quick help!

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    the “Custom Command” can only added once per table, on the “Edit” screen. So as soon as you want the same table in multiple languages, this will not really work.

    Instead, I suggest to “invent” custom locales (e.g. “es_ES_product” or “es_ES_store” or whatever your tables are dealing with) and then use the approach with the Extension, where you then create corresponding lang-es_ES_store.php files, and then assign that new locale in the Shortcode parameter, via datatables_locale=es_ES_store, etc.

    Regards,
    Tobias

    Thread Starter Joris

    (@jorisdw13)

    I have enough info now to figure out another way to approach this.

    Thank you Tobias!

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! ?? Good to hear that this helped!

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress in the plugin directory. Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Translations not showing’ is closed to new replies.