I am trying to: Translate or change the Add new link and text at repetitive Upload field in forms.
I dont see the string in wpml string translation.
Hi, there are a couple of filters you can use to modify the "Add New" and "Delete" repetition texts with PHP:
add_filter('toolset_button_delete_repetition_text', 'toolset_button_delete_repetition_text', 10, 2);
function toolset_button_delete_repetition_text($text, $config)
{
return 'Your delete text';
}
add_filter('toolset_button_add_repetition_text', 'toolset_button_add_repetition_text', 10, 2);
function toolset_button_add_repetition_text($text, $config)
{
return '+ Your add new text';
}
If you need different texts for different languages, you can use the WPML ICL_LANGUAGE_CODE in a conditional. I can show you some examples if you need them, just let me know.
Hi Christian,
how can I translate the content of the file upload button on the front end? I don't want to buy WPML for just a few items that were not included under the Messages translations under Edit Post Form. It's not a multilingual site, just one language other than english. There should be no need for a translation plugin, correct?
I'm sure there is some code like the above to do this?
If you could teach us how to fish, that would be great as we don't need to beg for the fish for every similar case 😉
Thanks.
Also I added the above code on my site under Toolset > Settings > Custom Code > Run on Frontend, but it doesn't work.
Ok, I saw in another post it needs to go under functions.php of my theme and now it works.
What is the Toolset > Custom Code for?