• Resolved artyomo2

    (@artyomo2)


    <font _mstmutation=”1″></font>

    The situation is as follows: I have a bilingual website with Russian and English versions. I created two forms, one for the Russian page and another for the English page. However, the problem is that I added reCAPTCHA V2 to both forms, and while it displays correctly on the Russian page, it does not appear on the English page. Moreover, if I manage to fix this issue, how can I change the language of the reCAPTCHA depending on the active language of the page?
    Thank you in advance.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author IQComputing

    (@iqcomputing)

    Hello,

    At the provided link, the only available forms are in Elementor and not in Contact Form 7. This plugin only works with Contact Form 7 forms.

    We do have a wpcf7_recaptcha_locale filter hook in the following plugin file that you could use to switch the ReCaptcha language:

    recaptcha-v2.php LN 70
    apply_filters( ‘wpcf7_recaptcha_locale’, get_locale() )

    The usage of the filter hook could look something like this:

    /**
     * Return the curent page ReCaptcha locale.
     * Defaults to the site locale from get_locale() function.
     * 
     * @param String $locale
     * 
     * @return String $locale
     */
    add_filter( 'wpcf7_recaptcha_locale', function( $locale ) {
    	
    	// Example: domain.com/?lang=ru
    	if( isset( $_GET, $_GET['lang'] ) && 'ru' === $_GET['lang'] ) {
    		$locale = 'ru_RU';
    	}
    	
    	return $locale;
    	
    } );
Viewing 1 replies (of 1 total)
  • The topic ‘Recaptcha V2 not working, need help’ is closed to new replies.