Setting up recaptcha in a language other than English

Is this me or cannot recaptcha images be translated into a language other than EN? I have enter image description here and it is still in English. Is it intentional?

+6
source share
6 answers

For reCAPTCHA 2. Since some time has passed

This is your link to cdn look at the end, hl parameter

 <script src="https://www.google.com/recaptcha/api.js?onload=myCallBack&render=explicit&hl=fr" async defer></script> 

This is your captcha inside the form.

 <div id="recaptcha1"></div> 

This is your javascript, you can also specify lang code here, I assume one of them is enough

 var recaptcha1; var myCallBack = function() { //Render the recaptcha1 on the element with ID "recaptcha1" recaptcha1 = grecaptcha.render('recaptcha1', { 'sitekey': '6LdJLws_your site key', 'lang' : 'fr' });}; 

You can add multiple reCAPTCHAs using this method.

Here is the full language link: https://developers.google.com/recaptcha/docs/language?hl=en

+18
source

Just to minimize the answers above.

You do not need to add another <script> , speaking the same way as you already did with your html element (reCAPTCHA). The link to the API will also be changed.

<script src="https://www.google.com/recaptcha/api.js?explicit&hl=nl"></script>

For me, I changed the language code to nl (Dutch) after &hl= . But you can find your own language code: https://developers.google.com/recaptcha/docs/language

+5
source

To recapture 2 just add a script file with your language:

 <script src="https://www.google.com/recaptcha/api.js?hl=fr" async defer></script> 

Language codes here: https://developers.google.com/recaptcha/docs/language

+1
source

Look at this page, sliding down, and you will get the answer: https://developers.google.com/recaptcha/docs/customization

On your page where you find captcha for clients, within the <form> and up to the reCaptcha widget, you add this code:

 <script type="text/javascript"> var RecaptchaOptions = { lang : 'fr', }; </script> 

The following languages โ€‹โ€‹are supported:

English en / Dutch nl / French fr / German de / Portuguese pt / Russian ru / Spanish es / Turkish tr

Hope this helps you ...

0
source

You just need to add this function to the theme theme.php file and do it all. It really works for me. You can change the translation language by changing the country code in the h1 parameter. Here I use es here to translate into Spanish.

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 ); 
0
source

replace lang with hl and it will work:

 <script type="text/javascript"> var recaptcha1; var myCallBack = function() { //Render the recaptcha1 on the element with ID "recaptcha1" recaptcha1 = grecaptcha.render('recaptcha1', { 'sitekey': '6LdJLws_your site key', 'hl' : 'fr' }); }; </script> 
0
source

Source: https://habr.com/ru/post/954022/


All Articles