Thread Starter
susox
(@susox)
So, I managed to add in “class-wdm-contact-form-7-public.php” (line 222) the following code:
if (get_locale() == "es_ES") {
$language_code = "es";
}
is there any less intrusive approach?
thanks!
Hi susox,
You are modifying the right file and your approach is also correct.
A more efficient way of achieving your requirement is to add the following code to the file class-wdm-contact-form-7-public.php
$current_website_language_code = substr(get_locale(), 0, 2);
if($current_website_language_code!=$language_code){
$language_code=$current_website_language_code;
}
The above code will serve your requirement and will change the captcha to whatever language your website is set of.
Would this work with qtranslate-x ?
I am not actually seeing that file – I see
google-no-captcha-recaptcha/includes/contact-form-7/class-wdm-contact-form-7.php
but not the one he refers to
Is there not a way to autodetect language instead of choose language (like https://es.wordpress.org/plugins/no-captcha-recaptcha/ ) ??