I am using polylang to translate my wordpress site, it is in Japanese and english. The forms are built with contact form 7.
I found a some code to change the reCAPTCHA language from english to Japanese using the code below:
function wptricks24_recaptcha_scripts() {
wp_deregister_script( 'google-recaptcha' );
$url = 'https://www.google.com/recaptcha/api.js';
$url = add_query_arg( array(
'onload' => 'recaptchaCallback',
'render' => 'explicit',
'hl' => 'ja'), $url ); // es is the language code for Spanish language
wp_register_script( 'google-recaptcha', $url, array(), '2.0', true );
}
add_action( 'wpcf7_enqueue_scripts', 'wptricks24_recaptcha_scripts', 11 );
This makes all my forms display the reCAPTCHA in Japanese, is there a way I can make the reCAPTCHA on the english pages display in English and Japanese on the Japanese pages?