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

adding-lang-to-recaptcha #141

Closed
wants to merge 4 commits into from

Conversation

venkatvemuri28
Copy link

I was unable to use 'lang' prop to override the language.
it is just much simpler to let user send the lang attribute to the component using the hl attribute. and default to en.

makes everyone's live easier :D
Screen Shot 2019-07-10 at 5 16 10 PM
Screen Shot 2019-07-10 at 5 15 01 PM

Venkata Padma Kumar Vemuri added 4 commits July 10, 2019 17:05
adding documentation
adding proper link
Copy link
Collaborator

@hartzis hartzis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@padma-vemuri I can't find the hl as a parameter to render documented anywhere, https://developers.google.com/recaptcha/docs/display, but this is awesome if it is working.

@dozoisch Do you think we could cut an alpha to test on the codesandbox?

@@ -152,4 +155,5 @@ ReCAPTCHA.defaultProps = {
tabindex: 0,
size: "normal",
badge: "bottomright",
hl: "en",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 i think we should "default" it to undefined so it is backward compatible?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wondering, if we default it to undefined, in that case wouldn't the user must define on every case ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does say that when you do not supply a language, hl, it attempts to derive the users language.

Auto-detects the user's language if unspecified.

Also, i assumed the js param's were only for when loading the script like the way react-google-recaptcha currently tries to use hl, but again this is awesome if this works!

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this work we can remove the hl parameter from the URL I guess and pass it on the JS side only. and so it would go props || globalOption || en.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, I tried a codesandbox example using my fork. please, check!!
https://codesandbox.io/s/blissful-haze-ozk9y

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should "default" to 'en'. We should let the google decide the default language, Auto-detects the user's language if unspecified.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hartzis ah good point, so yeah props || globalOption || undefined.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hartzis makes sense. lets not default.

dozoisch added a commit that referenced this pull request Jul 14, 2019
@dozoisch
Copy link
Owner

Merged here: bb06d1e

@dozoisch dozoisch closed this Jul 14, 2019
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

Successfully merging this pull request may close these issues.

3 participants