Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RECAPTCHA_LANGUAGE not working on recaptcha v3 #174

Closed
CarlosEco opened this issue Jun 17, 2020 · 5 comments
Closed

RECAPTCHA_LANGUAGE not working on recaptcha v3 #174

CarlosEco opened this issue Jun 17, 2020 · 5 comments

Comments

@CarlosEco
Copy link

Recaptcha language is not working on recaptchav3 because recaptcha url param "hl" changed to "lang" on recaptchav3.
"hl" param is only working for recaptcha v2.

Any solution?

@Empereol
Copy link

I can also confirm that setting RECAPTCHA_LANGUAGE when using RecaptchaV3Module does nothing.

@Empereol
Copy link

Empereol commented Jun 17, 2020

It appears that the V3 module/service doesn't send any value for the language param like it does with the other module...

v3... Calls loadScript with empty string as urlParam: https://github.com/DethAriel/ng-recaptcha/blob/master/recaptcha/recaptcha-v3.service.ts#L130

Non-v3 call loadScript with langParam: https://github.com/DethAriel/ng-recaptcha/blob/master/recaptcha/recaptcha-loader.service.ts#L85

Looks like there is an outstanding PR that would fix this... 23a9d46#diff-3e21b2cc3505f1c08f8e2fba57c510efL130

@DethAriel , could that PR be accepted/merged?

@CarlosEco
Copy link
Author

CarlosEco commented Jun 18, 2020

@Empereol I think that in this pull request this line:

const langParam = this.language ? '&hl=' + this.language : '';

must be changed to:

const langParam = this.language ? '&lang=' + this.language : '';

@Empereol
Copy link

I haven't tried to implement this beyond just running a get to see the response but it appears the hl= is working and lang= doesn't... Please correct me if I'm wrong.

When I try to get https://www.google.com/recaptcha/api.js?render=***&lang=fr part of the response is src='https://www.gstatic.com/recaptcha/.../recaptcha__en.js'

But when I try https://www.google.com/recaptcha/api.js?render=***&hl=fr the same part comes back as src='https://www.gstatic.com/recaptcha/releases/.../recaptcha__fr.js'

Again, I haven't done anything more than checking the response... But it appears to me the hl= is at least still working.

@DethAriel
Copy link
Owner

Hi @CarlosEco and @Empereol!

I'm glad to let you know that this bug has been fixed in ng-recaptcha@6.0.2, which is compatible with Angular versions 6 through 10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants