开发者

Recaptcha translation

开发者 https://www.devze.com 2023-01-12 19:06 出处:网络
Does anyone know how to change text language from Recaptcha? I\'ve already tried: <script type=\"text/javascript\">

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.


For the reCAPTCHA V2 widget you can override the default interface language detection as a parameter to the javascript. See the new docs.

<script src="https://www.google.com/recaptcha/api.js?hl=fr"></script>


set your lang at last of api address (persian "farsi"):

https://www.google.com/recaptcha/api.js?hl=fa

find your language short name in https://developers.google.com/recaptcha/docs/language


Append &amp;hl=fr to the public key.


Appending the language code to your public key work very well :

define('RECAPTCHA_PUBLIC_KEY', '__YOUR_PUBLIC_KEY_HERE__&amp;hl=fr');
echo recaptcha_get_html(RECAPTCHA_PUBLIC_KEY);

So you can remove your JavaScript from your code. Or leave it if you use other options, but remove "lang:'fr'"


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:

you need to add the following code in your main HTML page anywhere before the <form> element where reCAPTCHA appears (this will not work if placed after the main script where reCAPTCHA is first invoked)

so also make sure that this code is placed before the <form> tag which encloses the reCAPTCHA widget.


RecaptchaOptions is never working.

Another solution is to add a parametrt hl= langCode while we including the captcha script

<script type="text/javascript" src="'. $server . '/challenge?k=' . $pubkey .  &hl=de">/script>


You pasted the incorrect js. There should not be a comma after lang: 'fr'. The correct code is:

<script type="text/javascript">
var RecaptchaOptions = {
   lang : 'fr'
};
</script>
0

精彩评论

暂无评论...
验证码 换一张
取 消