08
Aug, 2015
Aug, 2015
How do I configure reCAPTCHA to use another language?
To configure s2Member to use a different language for reCAPTCHA, you'll need to create an MU-Plugin, as described below, that replaces the default en
language code with one of the reCAPTCHA language codes.
Create this directory and file: /wp-content/mu-plugins/s2-translations.php
<?php
add_filter('gettext_with_context', function ($translated, $original, $context, $text_domain) {
if($text_domain === 's2member' && $context === 's2member-front recaptcha-lang-code' && $original === 'en')
$translated = 'es'; // Any code listed here: https://developers.google.com/recaptcha/docs/language?hl=en
return $translated; // Return final translation.
}, 10, 4);