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 hour, 16 minutes ago by Joris.
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!
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!
