验证码翻译
有谁知道如何从 Recaptcha 更改文本语言?
我已经尝试过:
<script type="text/javascript">
var RecaptchaOptions = {
lang : 'fr',
};
</script>
但它没有改变。
Does anyone know how to change text language from Recaptcha?
I've already tried:
<script type="text/javascript">
var RecaptchaOptions = {
lang : 'fr',
};
</script>
But it doesn't change.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
对于 reCAPTCHA V2 小部件,您可以覆盖默认界面语言检测作为 javascript 的参数。请参阅新的文档。
For the reCAPTCHA V2 widget you can override the default interface language detection as a parameter to the javascript. See the new docs.
在 api 地址最后设置您的语言(波斯语“farsi”):
在 https 中找到您的语言简称://developers.google.com/recaptcha/docs/language
set your lang at last of api address (persian "farsi"):
find your language short name in https://developers.google.com/recaptcha/docs/language
将
&hl=fr
附加到公钥。Append
&hl=fr
to the public key.将语言代码附加到您的公钥效果非常好:
因此您可以从代码中删除 JavaScript。或者,如果您使用其他选项,则保留它,但删除“lang:'fr'”
Appending the language code to your public key work very well :
So you can remove your JavaScript from your code. Or leave it if you use other options, but remove "lang:'fr'"
如果您指的是您试图解决的实际图像中的语言,不幸的是您无法更改该文本的语言,至少现在还不能。您唯一可以更改的是界面的语言(小部件中的文本/提示等)。
对评论的回复:嗯,根据文档< /a>,看来你说得对。此代码是否位于小部件出现的同一页面中?
文档还说:
因此还要确保将此代码放置在包含 reCAPTCHA 小部件的
If you mean the language in the actual images that you are trying to solve, unfortunately you can't change the language of that text, at least not yet. The only thing you can change is the language of the interface (the text/prompt in the widget, etc.).
Response to comment: well, according to the docs, you seem to have it right. Is this code place in the same page where the widget appears?
The docs also say:
so also make sure that this code is placed before the
<form>
tag which encloses the reCAPTCHA widget.RecaptchaOptions 永远不起作用。
另一个解决方案是在包含验证码脚本时添加参数 hl= langCode
RecaptchaOptions is never working.
Another solution is to add a parametrt hl= langCode while we including the captcha script
你粘贴了错误的js。 lang: 'fr' 后面不应有逗号。正确的代码是:
You pasted the incorrect js. There should not be a comma after lang: 'fr'. The correct code is: