Field Validation Translations
-
Hello,
I’m looking into an issue with the reCaptcha v2 for Contact Form 7 plugin. We’re using the following filter hook to provide validation for the reCaptcha:
wpcf7_validate_recaptcha
. We’re realizing that translations don’t seem to catch on here. For example, we have:$result->invalidate( $tag, esc_html__( 'Please verify that you are not a robot.', 'wpcf7-recaptcha' ) );
We can see translations are provided in Spanish (Venezuela) but when translations from that language are provided, these validation messages don’t seem to be translated. Everything else besides these validation messages get translated as expected.
Also, if I error log the text in an early hook such as
template_redirect
, I get the translated text as expected. Maybe it has something to do with being dynamically pulled?add_action( 'template_redirect', function() { // Logs "Por favor, verifica que no eres un robot." as expected. error_log( esc_html__( 'Please verify that you are not a robot.', 'wpcf7-recaptcha' ) ); } );
Do you have any insight into why these strings are not being translated? Have you run into any similar issues with the validation hooks not providing translations? Should we not provide
wpcf7_validate_
with pre-translated strings or provide them these strings in a different way?Thank you for any suggestions or thoughts you may have!
- The topic ‘Field Validation Translations’ is closed to new replies.