Skip Navigation

[Resolved] Recaptcha

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 4 replies, has 2 voices.

Last updated by Minesh 1 year, 2 months ago.

Assisted by: Minesh.

Author
Posts
#2652403

Hello,

it's possible to modify language "I'm not robot" in french "je ne suis pas un robot" ? witch captcha toolset ?

Thank you

#2652459

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

There is no native way to change the captcha language but we can workaround it by adding custom Javascript code.

Can you please share on what page you want to change the language of the captcha (please share problem URL) and share admin access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2653181

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I see the captcha on the following page:
=> hidden link

I see the following form is added with the above page:
=> hidden link

I've added the following custom JS code to above form's JS editor box:

jQuery(document).ready(function($){
  
  setCaptchaLang('fr');
  function setCaptchaLang(lang) {

      const container = document.getElementsByClassName('g-recaptcha')[0];

      // Get GoogleCaptcha iframe
      const iframeGoogleCaptcha = container.querySelector('iframe');

      // Get language code from iframe
      const actualLang = iframeGoogleCaptcha.getAttribute("src").match(/hl=(.*?)&/).pop();

      // For setting new language
      if (actualLang !== lang) {
        iframeGoogleCaptcha.setAttribute("src", iframeGoogleCaptcha.getAttribute("src").replace(/hl=(.*?)&/, 'hl=' + lang + '&'));
      }
    }

});

You should add the above custom JS code to whatever form you add captcha.

I can see it works as expected on the frontend: hidden link

#2653185
cvsportsjob.png

Sorry, désolé, mais je ne vois pas en français le texte dans le captcha

Thank you

#2653201

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I can see the text in French as you can see with the following screenshot:
- hidden link

You should try to delete the browser and server cache and then try to test. At this end its working as expected.

#2653203

Ok thank you.