Skip to content

Commit

Permalink
add props language (#298)
Browse files Browse the repository at this point in the history
* add props language

user set language

* Update Recaptcha.js

yep, if empty by default, is that ok? I just tested it and it worked, I can get the browser default.

* Update Recaptcha.js

oh, sorry, I forget to push local.
  • Loading branch information
nanyanchao authored and DanSnow committed Nov 27, 2019
1 parent f98ac8a commit 894f4e8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Recaptcha.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ export default {
recaptchaHost: {
type: String,
default: 'www.google.com'
},
language:{
type:String,
default:''
}
},
beforeMount () {
Expand All @@ -41,7 +45,7 @@ export default {
// Note: vueRecaptchaApiLoaded load callback name is per the latest documentation
const script = document.createElement('script')
script.id = this.recaptchaScriptId
script.src = `https://${this.recaptchaHost}/recaptcha/api.js?onload=vueRecaptchaApiLoaded&render=explicit`
script.src = `https://${this.recaptchaHost}/recaptcha/api.js?onload=vueRecaptchaApiLoaded&render=explicit&hl=${this.language}`
script.async = true
script.defer = true

Expand Down

0 comments on commit 894f4e8

Please sign in to comment.