Hello,
I would like to ask, how could I add function which would respond to current website’s language and adjust Invisible ReCAPTCHA to it? Now, we have on all three localisations of our website (http://www.lesoteka-hise.si) same language in Recaptcha element.
I tried using the code below, but there was no change.
function lango_recaptcha_scripts() {
wp_deregister_script( ‘google-recaptcha’ );
$pagelang= get_bloginfo(“language”);
$url = ‘https://www.google.com/recaptcha/api.js’;
$url = add_query_arg( array(
‘onload’ => ‘recaptchaCallback’,
‘render’ => ‘explicit’,
‘hl’ => $pagelang), $url ); // language by check the active on the page
wp_register_script( ‘google-recaptcha’, $url, array(), ‘2.0’, true );
}
add_action( ‘wpcf7_enqueue_scripts’, ‘lango_recaptcha_scripts’, 11 );
Best regards,
Tamil