Skip Navigation

[Resolved] Cant translate add new button at repetitive upload field

This support ticket is created 5 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 3 replies, has 3 voices.

Last updated by Daniel Stadeli 5 years, 2 months ago.

Assisted by: Christian Cox.

Author
Posts
#1331493
2019-09-04_14-52-29.png

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.

#1331557

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.

#1339119
replace_button.jpg
file_upload_button.jpg

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.

#1339141
add_new_repeatable_text_field.jpg

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?