Change locale
Hi, thanks for the plugin.
How we can change locale? Maybe is some add_filter for this?
Hi @vitalijm, what do you mean by locale? Do you mean language or something?
Yes @irvinlim, language. I can't find where or how to show recaptcha in other language.
The language of the reCAPTCHA widget should be automatically loaded based on the user's locale.
There seems to be a way to fix the language though: https://developers.google.com/recaptcha/docs/display
Is this what you are looking for?
I need something like:
add_action( 'wpcf7_enqueue_scripts', 'custom_recaptcha_enqueue_scripts', 11 );
function custom_recaptcha_enqueue_scripts() {
wp_deregister_script( 'google-recaptcha' );
$url = 'https://www.google.com/recaptcha/api.js';
$url = add_query_arg( array(
'onload' => 'recaptchaCallback',
'render' => 'explicit',
'hl' => 'fr-CA' ), $url );
wp_register_script( 'google-recaptcha', $url, array(), '2.0', true );
}
Where most important part of code is "'hl' => 'fr-CA'", with this I can now modify recaptcha display language.
Or realize logic with add_filter, I don't know what in your situation is better.
I currently don't have the bandwidth to work on this plugin. If you wish you can create a PR to add an ACF option to modify the hl parameter when fetching api.js.
The list of language codes is here: https://developers.google.com/recaptcha/docs/language