Startseite › Toolset Professional Support › [Gelöst] 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.
Dieses Thema wurde abgetrennt von https://toolset.com/de/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 | - |
Zeitzone des Unterstützers: Asia/Kolkata (GMT+05:30)
Dieses Thema enthält 5 Antworten, hat 2 Stimmen.
Zuletzt aktualisiert von Minesh vor 1 year, 2 months.
Assistiert von: 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!!