• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.4 Incorrect language for No CAPTCHA.

#1
Hello,

I've just installed the 1.4.4 update specifically to enable the recent reCAPTCHA (No CAPTCHA) and it's rendering it in the wrong language (french) which I assume is due to the servers location being in France.

I'm looking for the template that loads the captcha or that loads the javascript for it since there are language code options for recaptcha.

Any help would be much appreciated.
 

Brogan

XenForo moderator
Staff member
#3
The template is captcha_nocaptcha but I'm not sure if there are any params available to force the language (I haven't looked into it).
 

Mike

XenForo developer
Staff member
#5
We don't specify a specific language code so we're allowing Google to detect your language (which is presumably using the Accept-Language header, though it could be doing GeoIP).
 
#6
We don't specify a specific language code so we're allowing Google to detect your language (which is presumably using the Accept-Language header, though it could be doing GeoIP).
The Accept-Language is "en-GB,en;q=0.8" so I guess it's from GeoIP.
 
#7
For anyone else that has this issue and want to force a specific language, you'll need to go into both of the "xenforo.js" files and change the following:

Code:
getScript("https://www.google.com/recaptcha/api.js?onload=XFNoCaptchaCallback&render=explicit")
to
Code:
getScript("https://www.google.com/recaptcha/api.js?onload=XFNoCaptchaCallback&render=explicit&hl=en-GB")
You can find the language codes here: https://developers.google.com/recaptcha/docs/language
 

Skylined

Active member
#8
I've modified the two files, and it's working. (y)

It would be better if XenForo could have an option to specify the language instead of having to edit files. :)