Home › Toolset Professional Support › [Resolved] Split: How to translate all messages from the user forms? – how to translate — not set —
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.
Our next available supporter will start replying to tickets in about 7.15 hours from now. Thank you for your understanding.
This topic is split from https://toolset.com/forums/topic/how-to-translate-all-messages-from-the-user-forms/
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10: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/Kolkata (GMT+05:30)
This topic contains 5 replies, has 2 voices.
Last updated by Minesh 1 month, 3 weeks ago.
Assisted by: Minesh.
Hi Minesh,
Ok, so you won't see it in the backend.
Other tranlation question, where can I translate --- not set --- and Please validate reCAPTCHA?
Cheers
Marco
Hello. Thank you for contacting the Toolset support.
Can you please try to use the following code in order to translate not set text:
add_filter('gettext', function($res, $text, $dom){ if( $res == '--- not set ---' && $domain = 'wpv-views' ){ $res = 'custom text not set'; } return $res; }, 10, 3);
And the Please validate reCAPTCHA in the same way?
add_filter('gettext', function($res, $text, $dom){ if( $res == 'Please validate reCAPTCHA' && $domain = 'wpv-views' ){ $res = 'custom text Please validate reCAPTCHA'; } return $res; }, 10, 3);
Yes - that should work.
Can I combine the two? How would this be?
You can use it like as follows:
add_filter( 'gettext', 'func_translate_text', 20, 3 ); function func_translate_text( $res , $text, $domain ) { if( $res == '--- not set ---' && $domain == 'wpv-views' ){ $res = 'custom text not set'; } if( $res == 'Please validate reCAPTCHA' && $domain == 'wpv-views' ){ $res = 'custom text Please validate reCAPTCHA'; } return $res; }
Thanks Minesh!!