Difference between revisions of "Google reCAPTCHA"

From WHMCS Documentation

(Language)
m
Line 17: Line 17:
  
 
<gallery widths=300px perrow=2>
 
<gallery widths=300px perrow=2>
File:red.jpg|red reCAPTCHA
+
File:red.jpg|'red' reCAPTCHA
File:white.jpg|white reCAPTCHA
+
File:white.jpg|'white' reCAPTCHA
File:blackglass.jpg|blackglass reCAPTCHA
+
File:blackglass.jpg|'blackglass' reCAPTCHA
File:clean.jpg|clean reCAPTCHA
+
File:clean.jpg|'clean' reCAPTCHA
 
</gallery>
 
</gallery>
  

Revision as of 19:09, 19 December 2011

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 i18n