Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to set localization in google recaptcha

I am using google recaptcha in my web application. My web application works for both English and French. Is it possible to add the localization in my google recaptcha too?

like image 667
Madhesh Avatar asked Aug 05 '15 09:08

Madhesh


3 Answers

Even you can set it when you want to initialize

<script src='https://www.google.com/recaptcha/api.js?hl=en'></script>
like image 166
Ghaly Saqqal Avatar answered Oct 05 '22 23:10

Ghaly Saqqal


You can set language in recaptcha option. Place this code before you call recaptcha.

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

The language codes are available Here.

If you want to render recaptcha automatically using the widget, Here is the documentation is available.

You can use Javascript resources(api.js) by passing hl parameter to it.

like image 20
Musakkhir Sayyed Avatar answered Oct 05 '22 23:10

Musakkhir Sayyed


Note, it is not lang but hl now

var RecaptchaOptions = 
{
    'sitekey' : '6LcgSAMTAAAAACc2C7rc6HB9ZmEX4SyB0bbAJvTG',
    hl : 'fr'
};

grecaptcha.render('html_element', RecaptchaOptions );
like image 26
Maxim Avatar answered Oct 06 '22 00:10

Maxim