Index: captcha.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/captcha/captcha.module,v
retrieving revision 1.42.2.18
diff -u -b -B -u -p -r1.42.2.18 captcha.module
--- captcha.module	15 Aug 2007 19:57:15 -0000	1.42.2.18
+++ captcha.module	16 Aug 2007 10:02:35 -0000
@@ -100,8 +100,18 @@ function _captcha_available_challenge_ty
 /**
  * Get the description which appears above the captcha in forms.
  */
-function _captcha_get_description() {
-  return variable_get('captcha_description', t('This question is used to make sure you are a human visitor and to prevent spam submissions.'));
+function _captcha_get_description($lang_code=NULL) {
+  if (module_exists('locale')) {
+    if ($lang_code == NULL) {
+      global $locale;
+      $lang_code = $locale;
+    }
+    $description = variable_get("captcha_description_$lang_code", t('This question is used to make sure you are a human visitor and to prevent spam submissions.'));
+  }
+  else {
+    $description = variable_get('captcha_description', t('This question is used to make sure you are a human visitor and to prevent spam submissions.'));
+  }
+  return $description;
 }
 
 /**
@@ -189,13 +199,31 @@ function captcha_admin_settings($form_id
       ))
     );
   }
-  // field for setting the additional captcha description
+  // field(s) for setting the additional captcha description
+  if (module_exists('locale')) {
+    global $locale;
+    $langs = locale_supported_languages();
+    $form["captcha_descriptions"] = array(
+      '#type' => 'fieldset',
+      '#title' => t('Captcha descriptions'),
+      '#description' => t('With this description you can explain to the user why the captcha needs to be solved. When the description is left empty, the captcha won\'t be be embedded in a fieldset either.'),
+    );
+    foreach ($langs['name'] as $lang_code => $lang_name) {
+      $form["captcha_descriptions"]["captcha_description_$lang_code"] = array(
+        '#type' => 'textfield',
+        '#title' => t('Captcha description for %lang_name', array('%lang_name'=>$lang_name)),
+        '#default_value' => _captcha_get_description($lang_code),
+      );
+    }
+  }
+  else {
   $form["captcha_description"] = array(
     '#type' => 'textfield',
     '#title' => t('Captcha description'),
-    '#description' => t('With this description you can explain to the user why the captcha needs to be solved.'),
+      '#description' => t('With this description you can explain to the user why the captcha needs to be solved. When the description is left empty, the captcha won\'t be be embedded in a fieldset either.'),
     '#default_value' => _captcha_get_description(),
   );
+  }
   // field for captcha persistence
   $form["captcha_persistence"] = array(
     '#type' => 'checkbox',
@@ -242,7 +270,16 @@ function captcha_admin_settings_submit($
         db_query("UPDATE {captcha_points} SET module = '%s', type = '%s' WHERE form_id = '%s'", $module, $type, $form_id);
       }
     }
+    // description stuff
+    if (module_exists('locale')) {
+      $langs = locale_supported_languages();
+      foreach ($langs['name'] as $lang_code => $lang_name) {
+        variable_set("captcha_description_$lang_code", $form_values["captcha_description_$lang_code"]);
+      }
+    }
+    else {
     variable_set('captcha_description', $form_values['captcha_description']);
+    }
     variable_set('captcha_persistence', $form_values['captcha_persistence']);
     drupal_set_message(t('Your captcha settings were saved.'), 'status');
   }
