Index: terms_of_use.module
===================================================================
--- terms_of_use.module	(revision 282)
+++ terms_of_use.module	(working copy)
@@ -123,38 +123,63 @@
   else {
     form_set_error('terms_of_use_node_title', t('You must specify a node title.'));
   }
+  if (module_exists('i18nstrings')) {
+    $language = language_default('language');
+    tt('terms_of_use:tou:fieldset_name', $form_state['values']['terms_of_use_fieldset_name'], $language, TRUE);
+    tt('terms_of_use:tou:checkbox_label', $form_state['values']['terms_of_use_checkbox_label'], $language, TRUE);
+  }
 }
 
 /**
  * Implementation of hook_form_form_id_alter().
  */
 function terms_of_use_form_user_register_alter(&$form, $form_state) {
+
+  global $language;
+  if (module_exists('i18nstrings')) {
+    $str_title = tt('terms_of_use:tou:fieldset_name', variable_get('terms_of_use_fieldset_name', t('Terms of Use')));
+    $checkbox_label = tt('terms_of_use:tou:checkbox_label', variable_get('terms_of_use_checkbox_label', t('I agree with these terms.')));
+  }
+  else {
+    $str_title = variable_get('terms_of_use_fieldset_name', 'Terms of Use');
+    $checkbox_label = variable_get('terms_of_use_checkbox_label', 'I agree with these terms.');
+  }
+
+
   // Adding the fieldset.
   $form['terms_of_use'] = array(
     '#type' => 'fieldset',
-    '#title' => check_plain(variable_get('terms_of_use_fieldset_name', t('Terms of Use'))),
+    '#title' => check_plain($str_title),
     '#weight' => 10,
   );
 
+  $show_terms = TRUE;
   // Getting the node that contains the Terms of Use.
   $terms_of_use_node_id = variable_get('terms_of_use_node_id', '');
-  if (module_exists('translation')) {
-    global $language;
-    $translations = translation_node_get_translations($terms_of_use_node_id);
-    if ($translations[$language->language]) {
-      $terms_of_use_node_id = $translations[$language->language]->nid;
+  if ($terms_of_use_node_id) {
+    if (module_exists('translation')) {
+      global $language;
+      $translations = translation_node_get_translations($terms_of_use_node_id);
+      if ($translations[$language->language]) {
+        $terms_of_use_node_id = $translations[$language->language]->nid;
+      }
     }
+    $node = node_load($terms_of_use_node_id);
   }
-  $node = node_load($terms_of_use_node_id);
-  
+  else {
+    $show_terms = FALSE;
+  }  
+
   // Will we show the full text of the Terms or only provide a link to the Terms.
   // Reading the checkbox label to find out.
-  $show_terms = TRUE;
-  $checkbox_label = check_plain(variable_get('terms_of_use_checkbox_label', t('I agree with these terms.')));
+
   if (strpos($checkbox_label, '@link') !== FALSE) {
-    $checkbox_label = str_replace('@link', l(check_plain($node->title), 'node/'. $node->nid), $checkbox_label);
+    $checkbox_label = str_replace('@link', l(check_plain($node->title), 'node/'. $node->nid), check_plain($checkbox_label));
     $show_terms = FALSE;
-  }  
+  }
+  else {
+    $checkbox_label = check_plain($checkbox_label);
+  }
     
   // Adding the Terms of Use to the fieldset. 
   if ($show_terms && $node) {
@@ -215,3 +240,18 @@
 
   return $output;
 }
+
+/**
+ * Implementation of hook_locale().
+ */
+function terms_of_use_locale($op = 'groups', $group = NULL) {
+  switch ($op) {
+    case 'groups':
+      return array('terms_of_use' => t('Terms of Use'));
+    case 'refresh':
+        if(module_exists('i18nstrings')) {
+          tt('terms_of_use:tou:fieldset_name', variable_get('terms_of_use_fieldset_name', t('Terms of Use')), NULL, TRUE);
+          tt('terms_of_use:tou:checkbox_label', variable_get('terms_of_use_checkbox_label', t('I agree with these terms.')), NULL, TRUE);
+        }
+  }
+}
