Hi,
since enfold version 5.4 and PHP 8.0.27 or 8.1.15 the text in the Google reCaptcha V2 version is only output in English. No matter what language is set in the browser. Below is the complete iframe. Our key is made unrecognizable with an x
<div><iframe title="reCAPTCHA" src="https://www.google.com/recaptcha/api2/anchor?ar=1&k=xxxxxxxxxxxxxxxxxxxxxxxxx&co=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&hl=en&v=tNAc29ZZrpcOCErva2nr4BS9&theme=light&size=normal&cb=6c3b77hgxlr9" role="presentation" name="a-6benibceywwt" scrolling="no" sandbox="allow-forms allow-popups allow-same-origin allow-scripts allow-top-navigation allow-modals allow-popups-to-escape-sandbox allow-storage-access-by-user-activation" width="304" height="78" frameborder="0"></iframe></div><textarea id="g-recaptcha-response" name="g-recaptcha-response" class="g-recaptcha-response" style="width: 250px; height: 40px; border: 1px solid rgb(193, 193, 193); margin: 10px 25px; padding: 0px; resize: none; display: none;"></textarea></div><iframe style="display: none;"></iframe></div>
You can see the en behind hl=
We tested this in 3 other sites. All pages start with <html lang=”de-DE”
And the V2 recaPtcha shows I’m not a robot / Privacy and Terms instead of “Ich bin kein Roboter” and Datenschutzerklärung-Nutzungsbedingungen
Regards
Hi!
Thank you for the inquiry.
Have you tried adjusting the hl parameter in the URL or in the src value?
// https://developers.google.com/recaptcha/docs/display
Adding this filter in the functions.php file might help.
// https://kriesi.at/support/topic/recaptcha-v2-wpml/#post-1374230
add_filter('avf_google_recaptcha_apiurl_lang', function($lang, $context) {
if($context == 'frontend')
{
$lang = substr(get_locale(), 0, 2);
}
return $lang;
}, 10, 2);
Cheers!
Ismael
thanks Ismael,
it works!
Regards
Hi,
Glad Ismael could help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.
Best regards,
Mike