Skip Navigation

[Resolved] Change Please validate reCAPTCHA Text

This support ticket is created 7 years, 1 month 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
- 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 6 replies, has 2 voices.

Last updated by Minesh 7 years, 1 month ago.

Assisted by: Minesh.

Author
Posts
#593219

Tell us what you are trying to do?
I want to make the validation message for the reCAPTCHA more natural. Currently if you don't fill it out, it says "Please validate reCAPTCHA" which isn't really very natural sounding English (imho). I'd like it to say ""Please validate the reCAPTCHA" or even simply "The reCAPTCHA is required" to match other validation messages. Is this possible to change?

What is the link to your site?
hidden link

#593233

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - you can change the recaptcha message by editing your CRED form and navigate to section "Messages" where you will find the recaptcha text "Invalid captcha message" and you can setup the message as per your requirement.

#593244

Thanks, but the error text I'm seeing isn't listed as part of those messages. I see a "Invalid captcha message" field with value "Wrong CAPTCHA" but the text I'm seeing is "Please validate reCAPTCHA." I'm including the reCAPTCHa using this in the content box:

[cred_field field='recaptcha' value='' urlparam='' class='form-control' output='bootstrap']

This is the v2 recaptcha... maybe those other messages are for something else?

#593247

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Could you please try to add following code to your current theme's function.php file and try to resolve your issue.

add_filter( 'gettext', 'func_change_captcha_msg', 20, 3 );
function func_change_captcha_msg( $translated_text, $text, $domain ) {
    if($text == 'Please validate reCAPTCHA' && $domain = 'wpv-views'){
        $translated_text = "The reCAPTCHA is required";
    }
    return $translated_text;
}
#593250

I haven't tried yet but will tomorrow. I'm concerned though as I also want to translate this text using WPML. I actually have it working already to translate to Japanese. If I do the above, will it mess up translating to other languages?

#593251

This solution also doesn't seem to be a "Toolset" way to do it but rather a more generic (and maybe a little hacky) way... is there nothing built into to Toolset or WPML? Seems weird to be checking against the exact text which could change in the future potentially.

#593252

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

If you are going to use WPML to translate the text, then you just translate it from WPML for other languages. Because you need a change in core text string "Please validate reCAPTCHA", you need to use solution as I suggested.