-
AuthorPosts
-
June 16, 2021 at 9:55 pm #1306096
Hi,
I have an enfold website that is translated in Flemish (nl_BE) by WPML. Everything works fine, except for the Google ReCaptcha (V2) which is displayed in Russian.
When selecting the default language of the website (Dutch) it works fine and it shows the captcha in Dutch.
Do you know what causes this problem and how to fix this?
The website uses the latest versions of WPML, WordPress and Enfold
June 21, 2021 at 7:58 am #1306669Hey Paul,
Thank you for the inquiry.
Looks like Flemish is not available for recaptcha, or the API does not have this translation yet.
// https://developers.google.com/recaptcha/docs/language
To fix the issue, we might have to set the hl parameter manually in the enfold/framework/js/conditional_load/avia_google_recaptcha_api.js around line 210.
switch( this.version ) { case 'avia_recaptcha_v2': src += '?onload=av_recaptcha_main_api_loaded&render=explicit'; break; case 'avia_recaptcha_v3': src += '?onload=av_recaptcha_main_api_loaded&render=' + this.site_key3; break; }
Replace the code with:
var lang = document.getElementsByTagName("html")[0].getAttribute("lang").replace("-", "_"); switch( this.version ) { case 'avia_recaptcha_v2': src += '?onload=av_recaptcha_main_api_loaded&render=explicit&hl=' + lang; break; case 'avia_recaptcha_v3': src += '?onload=av_recaptcha_main_api_loaded&render=' + this.site_key3 + '&hl=' + lang; break; }
Best regards,
IsmaelJune 23, 2021 at 3:50 pm #1307172Dear Ismael,
Thank you for your reply. I have implemented this on my website, but unfortunately, this does not seem to change anything in the frontend.
Kind regards,
Paul
June 25, 2021 at 7:13 am #1307403 -
AuthorPosts
- You must be logged in to reply to this topic.