• Resolved siki88

    (@siki88)


    Hi,
    I’m using Recaptcha v2 on my Register Form and I use WPML for translation.
    The problem is that no matter which language I choose, the Recaptcha is always shown in English. I want to translate it and it seems not to be possible trough String Translation of WPML.
    I read somewhere that it’s possible to translate the recaptcha by changing the language string here:

    <script src=”https://www.google.com/recaptcha/api.js?hl=fr”></script&gt;

    Changing the fr to de would make it German instead of French for example.
    How can I apply that to my 6 register forms I have (English, German, French, Spanish, Italian, Portuguese) ? I couldn’t find a way in WordPress to edit the source of the Recaptcha?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Aswin Giri

    (@aswingiri)

    Hello @siki88

    You can use the following snippet to pass WPML active language to script:

    add_filter( 'um_recaptcha_language_code', function( $language_code ){
    
    	if(defined('WPML_PLUGIN_BASENAME')){
    		global $sitepress;
    		$language_code = $sitepress->get_current_language();
    	}
    
    	return $language_code;
    	
    },25 );
    Thread Starter siki88

    (@siki88)

    Amazing! Thank you a lot. Worked!

    Plugin Support Ultimate Member Support

    (@ultimatemembersupport)

    Thanks for letting us know.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Translate Recaptcha’ is closed to new replies.