Skip to content

Commit bb06d1e

Browse files
committed
Merge Pull Request dozoisch#141 Adding lang to props
2 parents bcaca95 + 556aa4f commit bb06d1e

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Properties used to customise the rendering:
4949
| onExpired | func | *optional* callback when the challenge is expired and has to be redone by user. By default it will call the onChange with null to signify expired callback. |
5050
| onErrored | func | *optional* callback when the challenge errored, most likely due to network issues. |
5151
| stoken | string | *optional* set the stoken parameter, which allows the captcha to be used from different domains, see [reCAPTCHA secure-token] |
52+
| hl | string | *optional* set the hl parameter, which allows the captcha to be used from different languages, see [reCAPTCHA hl] |
5253
| size | enum | *optional* `compact`, `normal` or `invisible`. This allows you to change the size or do an invisible captcha |
5354
| badge | enum | *optional* `bottomright`, `bottomleft` or `inline`. Positions reCAPTCHA badge. *Only for invisible reCAPTCHA* |
5455

@@ -170,3 +171,4 @@ Pre `1.0.0` and `React < 16.4.1` support details in [0.14.0](https://github.com/
170171
[js_api]: https://developers.google.com/recaptcha/docs/display#js_api
171172
[rb]: https://github.com/react-bootstrap/react-bootstrap/
172173
[reCAPTCHA secure-token]: https://developers.google.com/recaptcha/docs/secure_token
174+
[reCAPTCHA hl]: https://developers.google.com/recaptcha/docs/language

src/recaptcha.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export default class ReCAPTCHA extends React.Component {
6464
"error-callback": this.handleErrored,
6565
size: this.props.size,
6666
stoken: this.props.stoken,
67+
hl: this.props.hl,
6768
badge: this.props.badge,
6869
});
6970
this.captcha.appendChild(wrapper);
@@ -124,6 +125,7 @@ export default class ReCAPTCHA extends React.Component {
124125
stoken,
125126
grecaptcha,
126127
badge,
128+
hl,
127129
...childProps
128130
} = this.props;
129131
/* eslint-enable no-unused-vars */
@@ -143,6 +145,7 @@ ReCAPTCHA.propTypes = {
143145
onErrored: PropTypes.func,
144146
size: PropTypes.oneOf(["compact", "normal", "invisible"]),
145147
stoken: PropTypes.string,
148+
hl: PropTypes.string,
146149
badge: PropTypes.oneOf(["bottomright", "bottomleft", "inline"]),
147150
};
148151
ReCAPTCHA.defaultProps = {
@@ -152,4 +155,5 @@ ReCAPTCHA.defaultProps = {
152155
tabindex: 0,
153156
size: "normal",
154157
badge: "bottomright",
158+
hl: "en",
155159
};

0 commit comments

Comments
 (0)