Index: privatemsg.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/privatemsg/privatemsg.module,v
retrieving revision 1.92
diff -u -r1.92 privatemsg.module
--- privatemsg.module	14 Oct 2008 17:00:41 -0000	1.92
+++ privatemsg.module	20 Oct 2008 20:56:49 -0000
@@ -36,7 +36,7 @@
     'type'             => MENU_NORMAL_ITEM,
   );
   $items['messages/inbox'] = array(
-    'title'            => 'Inbox',
+    'title'            => 'All messages',
     'page callback'    => 'privatemsg_list',
     'access arguments' => array('read privatemsg'),
     'type'             => MENU_DEFAULT_LOCAL_TASK,
@@ -74,7 +74,7 @@
     'weight'           => -10,
   );
   $items['messages/new'] = array(
-    'title' => 'Create',
+    'title'            => 'Write new message',
     'page callback'    => 'drupal_get_form',
     'page arguments'   => array('privatemsg_new'),
     'access arguments' => array('write privatemsg'),
@@ -191,28 +191,26 @@
 }
 
 function privatemsg_preprocess_privatemsg_to(&$vars) {
-  global $user;
+  if (!isset($vars['message']['participants'])) {
+  	// No participants at all... possible ?
+  	return;
+  }
+  
   $to = array();
-  if (isset($vars['message']['participants'])) {
-    foreach ($vars['message']['participants'] as $uid => $account) {
-      if ($account->uid == $user->uid) {
-        $last = theme('username', $account);
-      }
-      else{
-        $to[]= theme('username', $account);
-      }
-    }
+  foreach ($vars['message']['participants'] as $account) {
+  	$to[]= theme('username', $account);
   }
-  if (!($last) && count($to) > 0) {
-    $last = array_pop($to);
+   
+  $last = array_pop($to);
+  if (count($to) == 0) {
+  	// Only one participant
+    $vars['participants'] = t("From !last", array('!last' => $last));
+    return;
   }
 
+  // Multipe participants..
   $participants = implode(', ', $to);
-  if (drupal_strlen($participants)) {
-    $participants .= " and ";
-  }
-
-  $vars['participants'] = 'Between '. $participants . $last;
+  $vars['participants'] = t('Participants: !participants and !last',array('!participants' => $participants, '!last' => $last));
 }
 
 /**
@@ -268,13 +266,17 @@
       switch ($index) {
         case 'id':
           continue 2;
+        case 'subject':
+          $col = t('Subject');
+          break;
         case 'timestamp':
-          $col = arg(1) == 'sent' ? 'sent' : 'received';
+          $col = t('Last updated');
           break;
         default:
-          $col = $index;
+          //t($variable) should not be used, but are there actually any indexes missing?
+          $col = t($index);
       }
-      $head[$index] =  array('data' => t($col), 'field' => $index, 'sort'=> 'desc');
+      $head[$index] =  array('data' => $col, 'field' => $index, 'sort'=> 'desc');
     }
     if (arg(1) == 'inbox') {
       $query = _privatemsg_assemble_query('privatemsg_list', $account);
@@ -376,13 +378,13 @@
   if ($verbose) {
     if ($result) {
       if ($new == 1) {
-        $status = 'Unread';
+        $status = t('unread');
       }
       else {
-        $status = 'Read';
+        $status = t('read');
       }
       $total_marked = db_affected_rows();
-      drupal_set_message(format_plural($total_marked, "1 message marked as <em>!status</em>", '@count messages marked as <em>!status</em>', array('!status' => $status)));
+      drupal_set_message(format_plural($total_marked, "1 message marked as %status", '@count messages marked as %status', array('%status' => $status)));
     }
     else {
       drupal_set_message(t('An error has occured, please contact the site administrator.'), 'error');
@@ -490,12 +492,12 @@
   );
   $form['controls']['preview'] = array(
     '#type'               => 'submit',
-    '#value'              => 'Preview',
+    '#value'              => t('Preview message'),
     '#submit'             => array('pm_preview'),
   );
   $form['controls']['submit'] = array(
     '#type'               => 'submit',
-    '#value'              => 'Send',
+    '#value'              => t('Send message'),
     '#submit'             => array('pm_send'),
   );
   $form['controls']['cancel'] = array(
@@ -823,7 +825,7 @@
       if (user_access('write privatemsg') && $user->uid <> $account->uid) {
         $account->content['privatemsg_send_new_message'] = array(
           '#type'   => 'markup',
-          '#value'  => l('Send this user a private message', 'messages/new/'. $account->uid, array('query' => 'destination='. $_GET['q'])),
+          '#value'  => l(t('Send this user a message'), 'messages/new/'. $account->uid, array('query' => drupal_get_destination())),
           '#weight' => 10,
         );
       }
@@ -867,17 +869,14 @@
   }
   $links = array();
   if (user_access('write privatemsg')) {
-    $links[] = l('Create private message', 'messages/new');
-  }
-  if (user_access('read privatemsg') || user_access('read all private messages') ) {
-    $links[] = l('Inbox'. $new, 'messages/inbox');
+    $links[] = l(t('Write new message'), 'messages/new');
   }
   if (user_access('read privatemsg') || user_access('read all private messages') ) {
-    $links[] = l('Sent', 'messages/sent');
+    $links[] = l(t('All messages@new', array('@new' => $new)), 'messages/inbox');
   }
   if ( count( $links ) ) {
     $block = array(
-      'subject' => 'Private messages',
+      'subject' => t('Private messages'),
       'content' => theme('item_list', $links),
     );
   }
@@ -924,7 +923,7 @@
         );
         $form['content']['body'] = array(
           '#type' => 'textarea',
-          '#title' => t('Send reply to ' . $recipient),
+          '#title' => t('Send reply to %recipient', array('%recipient' => $recipient)),
           '#cols' => 10,
           '#rows' => 6,
           '#default_value' => isset($form_state['values']['body'])? $form_state['values']['body']: '',
