Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • sushismb Friend
    #198535

    Hello,

    I’d like to use reCaptcha in a different language by customizing it.

    I checked on other resources but I can’t seem to find where I can enter the translation text.

    I’d appreciate you help.

    THank you!

    Pankaj Sharma Moderator
    #538022

    hi the recaptcha plugin is core joomla plugin , it need to add API key . so we can not customize it ,here are some link hope it helps you

    https://developers.google.com/recaptcha/docs/customization
    https://developers.google.com/recaptcha/docs/tips
    https://developers.google.com/accounts/forum
    Also write on joomla forum

    sushismb Friend
    #538163

    Hello pankajsharma,

    I also did some research and checked the links you gave me.

    According to the Google Dev site, “Here is a working example of a custom italian translation (place this code before you call reCAPTCHA):”

    <script type=”text/javascript”>
    var RecaptchaOptions = {
    custom_translations : {
    instructions_visual : “Scrivi le due parole:”,
    instructions_audio : “Trascrivi ciu00f2 che senti:”,
    play_again : “Riascolta la traccia audio”,
    cant_hear_this : “Scarica la traccia in formato MP3”,
    visual_challenge : “Modalitu00e0 visiva”,
    audio_challenge : “Modalitu00e0 auditiva”,
    refresh_btn : “Chiedi due nuove parole”,
    help_btn : “Aiuto”,
    incorrect_try_again : “Scorretto. Riprova.”,
    },
    lang : ‘it’, // Unavailable while writing this code (just for audio challenge)
    theme : ‘red’ // Make sure there is no trailing ‘,’ at the end of the RecaptchaOptions dictionary
    };
    </script>

    I actually found something similar in the plugins/captcha/recaptcha/recaptcha.php as below;

    * Get the language tag or a custom translation
    *
    * @return string
    *
    * @since 2.5
    */
    private function _getLanguage()
    {
    // Initialise variables
    $language = JFactory::getLanguage();

    $tag = explode(‘-‘, $language->getTag());
    $tag = $tag[0];
    $available = array(‘en’, ‘pt’, ‘fr’, ‘de’, ‘nl’, ‘ru’, ‘es’, ‘tr’);

    if (in_array($tag, $available))
    {
    return “lang : ‘” . $tag . “‘,”;
    }

    // If the default language is not available, let’s search for a custom translation
    if ($language->hasKey(‘PLG_RECAPTCHA_CUSTOM_LANG’))
    {
    $custom[] =’custom_translations : {‘;
    $custom[] =”t”.’instructions_visual : “‘ . JText::_(‘PLG_RECAPTCHA_INSTRUCTIONS_VISUAL’) . ‘”,’;
    $custom[] =”t”.’instructions_audio : “‘ . JText::_(‘PLG_RECAPTCHA_INSTRUCTIONS_AUDIO’) . ‘”,’;
    $custom[] =”t”.’play_again : “‘ . JText::_(‘PLG_RECAPTCHA_PLAY_AGAIN’) . ‘”,’;
    $custom[] =”t”.’cant_hear_this : “‘ . JText::_(‘PLG_RECAPTCHA_CANT_HEAR_THIS’) . ‘”,’;
    $custom[] =”t”.’visual_challenge : “‘ . JText::_(‘PLG_RECAPTCHA_VISUAL_CHALLENGE’) . ‘”,’;
    $custom[] =”t”.’audio_challenge : “‘ . JText::_(‘PLG_RECAPTCHA_AUDIO_CHALLENGE’) . ‘”,’;
    $custom[] =”t”.’refresh_btn : “‘ . JText::_(‘PLG_RECAPTCHA_REFRESH_BTN’) . ‘”,’;
    $custom[] =”t”.’help_btn : “‘ . JText::_(‘PLG_RECAPTCHA_HELP_BTN’) . ‘”,’;
    $custom[] =”t”.’incorrect_try_again : “‘ . JText::_(‘PLG_RECAPTCHA_INCORRECT_TRY_AGAIN’) . ‘”,’;
    $custom[] =’},’;
    $custom[] =”lang : ‘” . $tag . “‘,”;

    return implode(“n”, $custom);
    }

    // If nothing helps fall back to english
    return ”;

    This is why I thought there could be a way to localize recaptcha in this file. But as you can see, it’s similar but different. I’m not sure if this is exactly where I should edit and how to edit.

    I’d appreciate any other information you may have.

    Thank you!

Viewing 3 posts - 1 through 3 (of 3 total)

This topic contains 3 replies, has 2 voices, and was last updated by  sushismb 10 years ago.

We moved to new unified forum. Please post all new support queries in our New Forum