Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter olidueggelin

    (@olidueggelin)

    Solution:
    add this to your function.php in your child theme:

    add_action( ‘wpcf7_enqueue_scripts’, ‘custom_recaptcha_enqueue_scripts’, 11 );

    function custom_recaptcha_enqueue_scripts() {
    	wp_deregister_script( 'google-recaptcha' );
    
    	$url = 'https://www.google.com/recaptcha/api.js';
    	$url = add_query_arg( array(
    		'onload' => 'recaptchaCallback',
    		'render' => 'explicit',
    	 	'hl' => 'de-DE' ), $url );
    
    	wp_register_script( 'google-recaptcha', $url, array(), '2.0', true );
    }

    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’ => ‘es’), $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 );

    It works fine too.

    • This reply was modified 7 years, 10 months ago by Lohith M.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Recaptcha Language’ is closed to new replies.