freskau
freskau

Reputation: 21

grecaptcha.render does not change language

I explicitly render the reCAPTCHA widget, but I'm not able to change the language according to the documentation.

Here is my onloadCallback:

var onloadCallback = function () {

    grecaptcha.render('captcha_element', {
        'sitekey': '<mysitekey>',
        'theme' : 'light',
        'hl': 'en'
    });
};

I am able to change the theme, but when I change the language code nothing is happening.

Upvotes: 2

Views: 2505

Answers (1)

Radek Budař
Radek Budař

Reputation: 91

"hl" is not a parametr of the "render" function, so you can't use it as is in your example. See:

https://developers.google.com/recaptcha/docs/display#auto_render

If you would like to render reCaptcah2 with localized text, you have to call api.js from google

https://www.google.com/recaptcha/api.js

with parameter "hl" and its value for example "cs" (for Czech language), so it means:

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

Upvotes: 3

Related Questions