My client doesn't like the word CAPTCHA when displaying the CAPTCHA authentication and wants that changed to "Security". I found the place to do that in the module in the title key in this array:

    // Add a CAPTCHA part to the form (depends on value of captcha_description)
    $captcha_description = _captcha_get_description();
    if ($captcha_description) {
      // $captcha_description is not empty: CAPTCHA part is a fieldset with description
      $form['captcha'] = array(
        '#type' => 'fieldset',
        '#title' => t('Security'),
        '#description' => $captcha_description,
        '#attributes' => array('class' => 'captcha'),
      );

And I changed it as appropriate. My question is, is there a better way to do this at the theme level so I'm not hacking the core module? Let me know or even providing a link to some instructions would be helpful.

Comments

matt b’s picture

I've changed a number of 'drupalisms' by enabling the locale module and creating my own translation of the strings that I didn't want to use.

gomez_in_the_south’s picture

Another solution for this is outlined in this post http://drupal.org/node/307150#comment-1102592

vacilando’s picture

Exactly same problem -- my client wants to remove or customize the term "captcha"... is there any user friendly way of doing that?

colemanw’s picture

This is easily done with String Overrides. Just type in the new text and you're done.

pdcrane’s picture

Title: Change the word "CAPTCHA" » Change the fieldset legend from "CAPTCHA"
Version: 6.x-1.x-dev » 7.x-1.2
Issue summary: View changes

Is there a clean way to do this in Drupal 7? Maybe with hook_form_alter?

Specifically I'm trying to change the fieldset legend on the Sitewide Contact Form.

I can change the text of the response text field using something similar to here: Junaidi's Blog - Drupal 7 Code Snippet: Alter CAPTCHA Response Text Field, but for the life of me, I can't figure out how to edit the Fieldset Legend programatically.

Any ideas?

Updated Title and Version Tag

flaviovs’s picture

function MYMODULE_preprocess_fieldset(&$vars)
{
  if ( $vars['element']['#title'] == t('CAPTCHA') )
    $vars['element']['#title'] = t('Security');
}

A dirty, ugly, and very inefficient hack. But at the end of the day, the job will be done.

hass’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

flaviovs’s picture

This is a slightly improved version of the ugly hack above:

function MYMODULE_preprocess_fieldset(&$vars)
{
  if ( isset($vars['element']['#title']) && $vars['element']['#title'] == t('CAPTCHA') )
    $vars['element']['#title'] = t('Security');
}