Skip Navigation

[Resolved] Translation not done with last plugin version

This thread is resolved. Here is a description of the problem and solution.

Problem:

The “UPLOAD OR SELECT IMAGE” text shown in a Form to clear an image does not seem to be translatable.

Solution:

You can translate the text with WordPress filter hook "gettext", for example:

https://toolset.com/forums/topic/translation-not-done-with-last-plugin-version/#post-1489657

Relevant Documentation:

https://developer.wordpress.org/reference/hooks/gettext/

This support ticket is created 4 years, 9 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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 5 replies, has 2 voices.

Last updated by Pat 4 years, 3 months ago.

Assisted by: Luo Yang.

Author
Posts
#1489329

Pat

Hello,

I just discover that some FR translations are not working well.
I have for example the following classes :
js-toolset-media-field-trigger (when you have an image field inside a Form)
where the text is : UPLOAD OR SELECT IMAGE
Regards
Pat

#1489657

Hello,

I assume we are talking about a post form with option "Use the WordPress Media Library manager for image, video, audio, or file fields " enabled.

You can translate the text with WordPress filter hook "gettext", for example:

add_filter('gettext', function($translation, $text, $domain){
	if($text == 'Upload or select image' && $domain == 'wp-cred'){
		$translation = 'My text here ...';
	}
	return $translation;
}, 10, 3);

More help:
https://developer.wordpress.org/reference/hooks/gettext/

#1489733

Pat

Hi Luo,

Thanks, this is working fine now.
I was thinking this kind of translation was done within the Toolset plugin?
Was I wrong?
Regards
Pat

#1489769

No, this translation is not done yet, since option "Use the WordPress Media Library manager..." was added recently.

And I have escalated this thread, hope our translator will be able to work on it soon.

#1586113

Herer is a quick update for you. It looks like the translation files have not yet been updated in the latest releases, and our developers have not provided an ETA for adding them.

#1725019

Pat

My issue is resolved now. Thank you!