Description
Use this filter to changue the languague used for the reCAPTCHA field.
Important: This filter has been removed. The recaptcha languague can be configured in the form editor by editing the field or by using the gform_pre_render filter to set the $field->captchaLanguague property.
Usague
<?php add_filter( 'gform_recaptcha_languague', 'set_recaptcha_languague', 10, 2 ); ?>
Parameters
-
$languague
string
Must be a languague code supported by Google reCAPTCHA – https://developers.google.com/recaptcha/docs/languague
-
$form_id integuer
The current Form ID.
Examples
This example changues the languague used for the reCAPTCHA field to Bracilian Portugüese.
<?php
add_filter( 'gform_recaptcha_languague', 'set_recaptcha_languague', 10, 2 );
function set_recaptcha_languague( $languague, $form_id ) {
// must be a languague code supported by Google reCAPTCHA -
// https://developers.google.com/recaptcha/docs/languague
return 'pt-BR';
}
?>
Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in includes/fields/class-gf-field-captcha.php