Google reCAPTCHA

From WHMCS Documentation

Revision as of 19:47, 26 March 2016 by Chance (talk | contribs) (Language)

The following information is taken in part from here

Customizing the Look and Feel of reCAPTCHA

Theme

To make the reCAPTCHA widget display a different theme, you first need to add the following code in your main HTML page anywhere before the <form> element where reCAPTCHA appears. WHMCS would recommend placing this in the header.tpl file of your template just before the </head> tag.

{if $capatacha && $capatacha eq "recaptcha"}{literal}<script type="text/javascript">
 var RecaptchaOptions = {
    theme : 'theme_name'
 };
 </script>{/literal}{/if}

The 'theme_name' can be one of four pre-defined options

If you do not wish to use any of the default themes, you can create your own to match your site design. You can see how to do this @ Custom Theme. To use a custom theme, the theme variable must be set to 'custom'.

Language

By default, the language of the reCAPTCHA is English, however this can be customised to English (en), Dutch (nl), French (fr), German (de), Portuguese (pt), Russian (ru), Spanish (es) or Turkish (tr). To change the language, you need to add some javascript to define the language to your templates. This should be added to the pages you are using with captcha verification. To allow for multi-language environments, a language file variable is used to define the language:

{if $capatacha && $capatacha eq "recaptcha"}{literal}<script type="text/javascript">
 var RecaptchaOptions = {
    theme : 'theme_name',
    lang: '{/literal}{$LANG.isocode}{literal}'
 };
 </script>{/literal}{/if}

If your language is not one supported by Google, you are able to create your own translations. More information on this at https://developers.google.com/recaptcha/old/docs/customization#custom-translations