From 11484fd7d420bbbd9aa9464dd103258092fcf8b9 Sat, 1 Sep 2012 22:00:28 +0200
From: hass <hass@85918.no-reply.drupal.org>
Date: Sat, 1 Sep 2012 21:59:34 +0200
Subject: [PATCH] Translatable string review

diff --git a/includes/workbench_moderation_handler_field_history_link.inc b/includes/workbench_moderation_handler_field_history_link.inc
index 40a6bea..f611528 100644
--- a/includes/workbench_moderation_handler_field_history_link.inc
+++ b/includes/workbench_moderation_handler_field_history_link.inc
@@ -16,7 +16,7 @@
 
     $this->options['alter']['make_link'] = TRUE;
     $this->options['alter']['path'] = "node/$node->nid/moderation";
-    $text = !empty($this->options['text']) ? $this->options['text'] : t('View Moderation History');
+    $text = !empty($this->options['text']) ? $this->options['text'] : t('View moderation history');
     return $text;
   }
 }
diff --git a/includes/workbench_moderation_handler_filter_state.inc b/includes/workbench_moderation_handler_filter_state.inc
index 0c1aef8..9fd52d7 100644
--- a/includes/workbench_moderation_handler_filter_state.inc
+++ b/includes/workbench_moderation_handler_filter_state.inc
@@ -7,7 +7,7 @@
 class workbench_moderation_handler_filter_state extends views_handler_filter_in_operator {
   function get_value_options() {
     if (!isset($this->value_options)) {
-      $this->value_title = t('Moderation Status');
+      $this->value_title = t('Moderation status');
       $this->value_options = array_map('check_plain', workbench_moderation_state_labels());
     }
   }
diff --git a/plugins/page_manager/tasks/nodedraft.inc b/plugins/page_manager/tasks/nodedraft.inc
index 26a5fc3..02e7765 100644
--- a/plugins/page_manager/tasks/nodedraft.inc
+++ b/plugins/page_manager/tasks/nodedraft.inc
@@ -10,7 +10,7 @@
     // This is a 'page' task and will fall under the page admin UI
     'task type' => 'page',
 
-    'title' => t('Node Draft'),
+    'title' => t('Node draft'),
     'admin title' => t('The draft page for moderated nodes.'),
     'admin description' => t('When enabled, this overrides the default node view at node/%node/draft'),
     'admin path' => 'node/%node/draft',
diff --git a/plugins/page_manager/tasks/noderevision.inc b/plugins/page_manager/tasks/noderevision.inc
index ec56bde..c4e07a6 100644
--- a/plugins/page_manager/tasks/noderevision.inc
+++ b/plugins/page_manager/tasks/noderevision.inc
@@ -10,7 +10,7 @@
     // This is a 'page' task and will fall under the page admin UI
     'task type' => 'page',
 
-    'title' => t('Node Revision'),
+    'title' => t('Node revision'),
     'admin title' => t('The revision page for moderated nodes.'),
     'admin description' => t('When enabled, this overrides the default node view at node/%node/revisions/%/view'),
     'admin path' => 'node/%node/revisions/%/view',
diff --git a/views/workbench_moderation.view.inc b/views/workbench_moderation.view.inc
index 1296929..adac7e4 100644
--- a/views/workbench_moderation.view.inc
+++ b/views/workbench_moderation.view.inc
@@ -2,8 +2,8 @@
 
 /**
  * @file workbench_moderation.view.inc
- * Default view. Provides two tabs on the Workbench, "My Drafts" and "Needs
- * Review", which list the moderation state for content relevant to the current
+ * Default view. Provides two tabs on the Workbench, "My drafts" and "Needs
+ * review", which list the moderation state for content relevant to the current
  * user.
  */
 
@@ -19,7 +19,7 @@
 
 /* Display: Defaults */
 $handler = $view->new_display('default', 'Defaults', 'default');
-$handler->display->display_options['title'] = 'Content I\'ve Edited';
+$handler->display->display_options['title'] = 'Content I\'ve edited';
 $handler->display->display_options['use_more_always'] = TRUE;
 $handler->display->display_options['use_more_text'] = 'view all';
 $handler->display->display_options['group_by'] = TRUE;
@@ -154,7 +154,7 @@
 $handler->display->display_options['fields']['log']['element_default_classes'] = 1;
 $handler->display->display_options['fields']['log']['hide_empty'] = 0;
 $handler->display->display_options['fields']['log']['empty_zero'] = 0;
-/* Field: Workbench Moderation: Moderation History Link */
+/* Field: Workbench Moderation: Moderation history link */
 $handler->display->display_options['fields']['workbench_moderation_history_link']['id'] = 'workbench_moderation_history_link';
 $handler->display->display_options['fields']['workbench_moderation_history_link']['table'] = 'node';
 $handler->display->display_options['fields']['workbench_moderation_history_link']['field'] = 'workbench_moderation_history_link';
@@ -176,12 +176,12 @@
 $handler->display->display_options['fields']['workbench_moderation_history_link']['hide_empty'] = 0;
 $handler->display->display_options['fields']['workbench_moderation_history_link']['empty_zero'] = 0;
 $handler->display->display_options['fields']['workbench_moderation_history_link']['hide_alter_empty'] = 0;
-/* Field: Moderation State */
+/* Field: Moderation state */
 $handler->display->display_options['fields']['state']['id'] = 'state';
 $handler->display->display_options['fields']['state']['table'] = 'workbench_moderation_node_history';
 $handler->display->display_options['fields']['state']['field'] = 'state';
-$handler->display->display_options['fields']['state']['ui_name'] = 'Moderation State';
-$handler->display->display_options['fields']['state']['label'] = 'Moderation State';
+$handler->display->display_options['fields']['state']['ui_name'] = 'Moderation state';
+$handler->display->display_options['fields']['state']['label'] = 'Moderation state';
 $handler->display->display_options['fields']['state']['alter']['alter_text'] = 1;
 $handler->display->display_options['fields']['state']['alter']['text'] = '<div>[state]</div><div>[workbench_moderation_history_link]</div>';
 $handler->display->display_options['fields']['state']['alter']['make_link'] = 0;
@@ -345,10 +345,10 @@
 $handler->display->display_options['filters']['current']['table'] = 'workbench_moderation_node_history';
 $handler->display->display_options['filters']['current']['field'] = 'current';
 
-/* Display: Needs Review Page */
-$handler = $view->new_display('page', 'Needs Review Page', 'needs_review_page');
+/* Display: Needs review page */
+$handler = $view->new_display('page', 'Needs review page', 'needs_review_page');
 $handler->display->display_options['defaults']['title'] = FALSE;
-$handler->display->display_options['title'] = 'Needs Review';
+$handler->display->display_options['title'] = 'Needs review';
 $handler->display->display_options['defaults']['access'] = FALSE;
 $handler->display->display_options['access']['type'] = 'perm';
 $handler->display->display_options['access']['perm'] = 'use workbench_moderation needs review tab';
@@ -358,7 +358,7 @@
 $handler->display->display_options['empty']['area']['table'] = 'views';
 $handler->display->display_options['empty']['area']['field'] = 'area';
 $handler->display->display_options['empty']['area']['empty'] = FALSE;
-$handler->display->display_options['empty']['area']['content'] = 'This list displays content in the "Needs Review" state that you can moderate. Currently there is no such content.';
+$handler->display->display_options['empty']['area']['content'] = 'This list displays content in the "Needs review" state that you can moderate. Currently there is no such content.';
 $handler->display->display_options['empty']['area']['format'] = 'plain_text';
 $handler->display->display_options['defaults']['filters'] = FALSE;
 /* Filter criterion: Workbench Moderation: Current */
@@ -404,13 +404,13 @@
 $handler->display->display_options['filters']['type']['expose']['reduce'] = 0;
 $handler->display->display_options['path'] = 'admin/workbench/needs-review';
 $handler->display->display_options['menu']['type'] = 'tab';
-$handler->display->display_options['menu']['title'] = 'Needs Review';
+$handler->display->display_options['menu']['title'] = 'Needs review';
 $handler->display->display_options['menu']['weight'] = '99';
 
-/* Display: Drafts Page */
-$handler = $view->new_display('page', 'Drafts Page', 'drafts_page');
+/* Display: Drafts page */
+$handler = $view->new_display('page', 'Drafts page', 'drafts_page');
 $handler->display->display_options['defaults']['title'] = FALSE;
-$handler->display->display_options['title'] = 'My Drafts';
+$handler->display->display_options['title'] = 'My drafts';
 $handler->display->display_options['defaults']['empty'] = FALSE;
 /* No results behavior: Global: Text area */
 $handler->display->display_options['empty']['area']['id'] = 'area';
@@ -472,11 +472,11 @@
 $handler->display->display_options['filters']['state']['expose']['reduce'] = 1;
 $handler->display->display_options['path'] = 'admin/workbench/drafts';
 $handler->display->display_options['menu']['type'] = 'tab';
-$handler->display->display_options['menu']['title'] = 'My Drafts';
+$handler->display->display_options['menu']['title'] = 'My drafts';
 $handler->display->display_options['menu']['weight'] = '98';
 $translatables['workbench_moderation'] = array(
   t('Defaults'),
-  t('Content I\'ve Edited'),
+  t('Content I\'ve edited'),
   t('view all'),
   t('Apply'),
   t('Reset'),
@@ -490,8 +490,8 @@
   t('revision user'),
   t('Nid'),
   t('Log message'),
-  t('Moderation History Link'),
-  t('Moderation State'),
+  t('Moderation history link'),
+  t('Moderation state'),
   t('<div>[state]</div><div>[workbench_moderation_history_link]</div>'),
   t('Moderate'),
   t('Title'),
@@ -499,12 +499,12 @@
   t('Revised by'),
   t('Last updated'),
   t('State'),
-  t('Needs Review Page'),
-  t('Needs Review'),
+  t('Needs review page'),
+  t('Needs review'),
   t('more'),
-  t('This list displays content in the "Needs Review" state that you can moderate. Currently there is no such content.'),
+  t('This list displays content in the "Needs review" state that you can moderate. Currently there is no such content.'),
   t('Workbench Moderation: State'),
-  t('Drafts Page'),
-  t('My Drafts'),
+  t('Drafts page'),
+  t('My drafts'),
   t('This list displays content you have created that is not published. Currently there is no such content.'),
 );
diff --git a/workbench_moderation.admin.inc b/workbench_moderation.admin.inc
index 7197cf5..ebcada5 100644
--- a/workbench_moderation.admin.inc
+++ b/workbench_moderation.admin.inc
@@ -156,7 +156,7 @@
   drupal_set_message(t('Your settings have been saved.'));
 
   // Warn users that changes here may need require reconfiguring Views that use Workbench.
-  $views_message = t('Depending on the changes you have made it may be necessary to <a href="@views" target="_blank">reconfigure Views</a> that leverage Workbench Moderation such as <a href="@workbench_moderation" target="_blank">workbench_moderation</a>', array('@views' => url('admin/structure/views'), '@workbench_moderation' => url('admin/structure/views/edit/workbench_moderation')));
+  $views_message = t('Depending on the changes you have made it may be necessary to <a href="@views">reconfigure Views</a> that leverage Workbench Moderation such as <a href="@workbench_moderation">workbench_moderation</a>', array('@views' => url('admin/structure/views'), '@workbench_moderation' => url('admin/structure/views/edit/workbench_moderation')));
   drupal_set_message($views_message, $type = 'warning', $repeat = FALSE);
 }
 
@@ -304,14 +304,14 @@
   $roles = user_roles();
   $form['role'] = array(
     '#type' => 'select',
-    '#title' => t('Drupal role:'),
+    '#title' => t('Drupal role'),
     '#description' => t('Select a role to check.'),
     '#options' => $roles,
   );
 
   $form['moderation_task'] = array(
     '#type' => 'select',
-    '#title' => t('Moderation task:'),
+    '#title' => t('Moderation task'),
     '#description' => t('Select a moderation task that the role should be able to perform.'),
     '#options' => array(
       'author' => t('Author moderated content'),
@@ -328,14 +328,14 @@
   }
   $form['types'] = array(
     '#type' => 'checkboxes',
-    '#title' => t('Content types:'),
+    '#title' => t('Content types'),
     '#description' => t('Select any content types on which the user should have the ability to perform the moderation task.'),
     '#options' => $types,
   );
 
   $form['submit'] = array(
     '#type' => 'submit',
-    '#value' => t('Check'),
+    '#value' => t('Check permissions'),
   );
 
   if (empty($types)) {
@@ -386,7 +386,7 @@
       drupal_set_message(t('The @role role may need the "!permission_label" permission in order to be a qualified @moderation_task of @types content.', array(
         '@role' => $role->name,
         '@moderation_task' => $moderation_task,
-        '@types' => implode(' and ', array(implode(', ', array_slice($types, 0, -1)), end($types))),
+        '@types' => implode(t(' and '), array(implode(', ', array_slice($types, 0, -1)), end($types))), // @TODO: Context senstive translation bug
         '!permission_label' => $all_permissions[$permission]['title'],
       )), 'error');
     }
diff --git a/workbench_moderation.module b/workbench_moderation.module
index b652b6f..de5c90d 100644
--- a/workbench_moderation.module
+++ b/workbench_moderation.module
@@ -42,7 +42,7 @@
   // Change the moderation state of a node.
   // Used in workbench_moderation_get_moderation_links()
   $items["node/%node/moderation/%/change-state/%"] = array(
-    'title' => 'Change Moderation State',
+    'title' => 'Change moderation state',
     'page callback' => 'workbench_moderation_moderate_callback',
     'page arguments' => array(1, 5),
     'load arguments' => array(3),
@@ -101,7 +101,7 @@
     'file' => 'workbench_moderation.admin.inc',
   );
   $items['admin/config/workbench/moderation/check-permissions'] = array(
-    'title' => 'Check Permissions',
+    'title' => 'Check permissions',
     'type' => MENU_LOCAL_TASK,
     'page callback' => 'drupal_get_form',
     'page arguments' => array('workbench_moderation_admin_check_role_form'),
@@ -401,10 +401,10 @@
     'title' => t('View the moderation messages on a node')
   );
   $permissions['use workbench_moderation my drafts tab'] = array(
-    'title' => t('Use "My Drafts" workbench tab')
+    'title' => t('Use "My drafts" workbench tab')
   );
   $permissions['use workbench_moderation needs review tab'] = array(
-    'title' => t('Use "Needs Review" workbench tab')
+    'title' => t('Use "Needs review" workbench tab')
   );
 
   // Per-node-type, per-transition permissions. Used by workbench_moderation_state_allowed().
@@ -417,7 +417,7 @@
 
     // Always set a permission to perform all moderation states.
     $permissions["moderate content from $from_state to $to_state"] = array(
-      'title' => t('Moderate all content from @from_state to @to_state', array('@from_state' => workbench_moderation_state_label($from_state), '@to_state' => workbench_moderation_state_label($to_state))),
+      'title' => t('Moderate all content from %from_state to %to_state', array('%from_state' => workbench_moderation_state_label($from_state), '%to_state' => workbench_moderation_state_label($to_state))),
     );
     // Per-node type permissions are very complex, and should only be used if
     // absolutely needed. For right now, this is hardcoded to OFF. To enable it,
@@ -426,7 +426,7 @@
     if (variable_get('workbench_moderation_per_node_type', FALSE)) {
       foreach ($node_types as $node_type) {
         $permissions["moderate $node_type state from $from_state to $to_state"] = array(
-          'title' => t('Moderate @node_type state from @from_state to @to_state', array('@node_type' => node_type_get_name($node_type), '@from_state' => workbench_moderation_state_label($from_state), '@to_state' => workbench_moderation_state_label($to_state))),
+          'title' => t('Moderate %node_type state from %from_state to %to_state', array('%node_type' => node_type_get_name($node_type), '%from_state' => workbench_moderation_state_label($from_state), '%to_state' => workbench_moderation_state_label($to_state))),
         );
       }
     }
@@ -586,28 +586,16 @@
 function workbench_moderation_help($path, $arg) {
   switch ($path) {
     case 'admin/help#workbench_moderation':
-      return '<p>' . t("Enables you to control node display with a moderation
-        workflow. You can have a 'Live revision' for all visitors and pending
-        revisions which need to be approved to become the new 'Live Revision.'") . '</p>';
+      return '<p>' . t("Enables you to control node display with a moderation workflow. You can have a 'Live revision' for all visitors and pending revisions which need to be approved to become the new 'Live revision.'") . '</p>';
 
     case 'admin/config/workbench/moderation':
-      return '<p>' . t("These are the states through which a node passes in order to become published. By
-        default, the Workbench Moderation module provides the states 'Draft,' 'Needs Review,' and 'Published.'
-        On this screen you may create, delete and re-order states. Additional states might include
-        'Legal Review,' 'PR Review,' or any or state your site may need.") . '</p>';
+      return '<p>' . t("These are the states through which a node passes in order to become published. By default, the Workbench Moderation module provides the states 'Draft,' 'Needs review,' and 'Published'. On this screen you may create, delete and re-order states. Additional states might include 'Legal review,' 'PR review', or any or state your site may need.") . '</p>';
 
     case 'admin/config/workbench/moderation/transitions':
-      return '<p>' . t("The Workbench Moderation module keeps track of when a node moves from one state to
-        another. By default, nodes begin in the %draft state and end in the %published state. The transitions
-        on this page control how nodes move from state to state.", array('%draft' => workbench_moderation_state_label(workbench_moderation_state_none()),
-        '%published' => workbench_moderation_state_label(workbench_moderation_state_published()))) . ' ' . l(t('Permission to perform these transitions
-        is controlled on a role-by-role basis.'), 'admin/people/permissions', array('fragment' => 'module-workbench_moderation')) . '</p>';
+      return '<p>' . t('The Workbench Moderation module keeps track of when a node moves from one state to another. By default, nodes begin in the %draft state and end in the %published state. The transitions on this page control how nodes move from state to state. <a href="@permissions">Permission to perform these transitions is controlled on a role-by-role basis</a>.', array('%draft' => workbench_moderation_state_label(workbench_moderation_state_none()), '%published' => workbench_moderation_state_label(workbench_moderation_state_published())), '@permissions' => url('admin/people/permissions', array('fragment' => 'module-workbench_moderation'))) . '</p>';
 
     case 'admin/config/workbench/moderation/check-permissions':
-      return '<p>' . t("In order to participate in the moderation process,
-        Drupal users must be granted several node- and moderation- related
-        permissions. This page can help check whether roles have the correct
-        permissions to author, edit, moderate, and publish moderated content.") . '</p>';
+      return '<p>' . t("In order to participate in the moderation process, Drupal users must be granted several node- and moderation- related permissions. This page can help check whether roles have the correct permissions to author, edit, moderate, and publish moderated content.") . '</p>';
   }
 }
 
@@ -864,8 +852,12 @@
 
   // Set a default revision log message.
   $logged_name = (user_is_anonymous() ? variable_get('anonymous', t('Anonymous')) : $user->name);
-  $logged_action = !empty($form['#node']->nid) ? t('Edited') : t('Created');
-  $form['revision_information']['log']['#default_value'] = t('!action by @user.', array('!action' => $logged_action, '@user' => $logged_name));
+  if (!empty($form['#node']->nid)) {
+    $form['revision_information']['log']['#default_value'] = t('Edited by @user.', array('@user' => $logged_name));
+  }
+  else {
+    $form['revision_information']['log']['#default_value'] = t('Created by @user.', array('@user' => $logged_name));
+  }
 
   // Move the revision log into the publishing options to make things pretty.
   if ($form['options']['#access']) {
diff --git a/workbench_moderation.node.inc b/workbench_moderation.node.inc
index 408170f..e0c0e86 100644
--- a/workbench_moderation.node.inc
+++ b/workbench_moderation.node.inc
@@ -80,7 +80,7 @@
   global $user;
 
   // Page title.
-  drupal_set_title(t('@title History', array('@title' => $node->title)), PASS_THROUGH);
+  drupal_set_title(t('History of %title', array('%title' => $node->title)), PASS_THROUGH);
 
   // Alert if there is no live node
   if (!isset($node->workbench_moderation['published'])) {
@@ -182,7 +182,7 @@
       $node_current = workbench_moderation_node_current_load($node);
       $row['data']['moderation'] = '<div class="moderation-state"><strong>' . t('This is the current revision. The current state is %state.', array('%state' => workbench_moderation_state_label($node->workbench_moderation['current']->state))) . '</strong></div>';
       $moderate_form = drupal_get_form('workbench_moderation_moderate_form', $node_current);
-      $row['data']['moderation'] .= '<div class="moderation-actions">' . t('Moderate') . ': ' . drupal_render($moderate_form) . '</div>';
+      $row['data']['moderation'] .= '<div class="moderation-actions">' . t('Moderate: !moderation-actions-form', array('!moderation-actions-form' => drupal_render($moderate_form))) . '</div>';
     }
 
     // Build a table of the moderation history.
@@ -190,20 +190,19 @@
     $items = array();
     foreach ($moderations as $moderation) {
       if ($moderation->from_state) {
-        $items[] = t('From @from_state --> @to_state on %date by !user',
+        $items[] = t('From %from_state --> %to_state on %date by !user',
           array(
-            '@from_state' => workbench_moderation_state_label($moderation->from_state),
-            '@to_state' => workbench_moderation_state_label($moderation->state),
+            '%from_state' => workbench_moderation_state_label($moderation->from_state),
+            '%to_state' => workbench_moderation_state_label($moderation->state),
             '%date' => format_date($moderation->stamp, 'short'),
             '!user' => theme('username', array('account' => $moderation)),
           )
         );
       }
       else {
-        $items[] = t('Created as @to_state on %date by !user',
+        $items[] = t('Created as %to_state on %date by !user',
           array(
-            '@from_state' => workbench_moderation_state_label($moderation->from_state),
-            '@to_state' => workbench_moderation_state_label($moderation->state),
+            '%to_state' => workbench_moderation_state_label($moderation->state),
             '%date' => format_date($moderation->stamp, 'short'),
             '!user' => theme('username', array('account' => $moderation)),
           )
@@ -216,7 +215,7 @@
   }
 
   // Set the table header.
-  $header = array(t('Revision'), t('Title'), t('Date'), t('Revision Actions'), t('Moderation Actions'));
+  $header = array(t('Revision'), t('Title'), t('Date'), t('Revision actions'), t('Moderation actions'));
 
   // Return properly styled output.
   return array(
@@ -261,7 +260,7 @@
   $current_state = $node->workbench_moderation['my_revision']->state;
   if ($next_states = workbench_moderation_states_next($current_state, $user, $node)) {
     $form['state'] = array(
-      '#title' => t('Set moderation state:'),
+      '#title' => t('Set moderation state'),
       '#type' => 'select',
       '#options' => $next_states,
       '#default_value' => _workbench_moderation_default_next_state($current_state, $next_states),
diff --git a/workbench_moderation.views.inc b/workbench_moderation.views.inc
index 9512698..85f723e 100644
--- a/workbench_moderation.views.inc
+++ b/workbench_moderation.views.inc
@@ -27,7 +27,7 @@
   );
 
   $data['workbench_moderation_node_history']['hid'] = array(
-    'title' => t('Moderation History ID'),
+    'title' => t('Moderation history ID'),
     'help' => t('Content moderation history record ID.'),
     'filter' => array(
       'handler' => 'views_handler_filter',
@@ -138,17 +138,17 @@
     ),
   );
   $data['workbench_moderation_node_history']['moderation_actions'] = array(
-    'title' => t('Moderation Actions'),
+    'title' => t('Moderation actions'),
     'help' => t('Content moderation state of the node revisision.'),
     'real field' => 'state',
     'field' => array(
-      'title' => t('Moderation Links'),
+      'title' => t('Moderation links'),
       'handler' => 'workbench_moderation_handler_field_links',
       'click sortable' => FALSE,
       'additional fields' => array('nid', 'vid', 'current'),
     ),
     'filter' => array(
-      'title' => t('User Can Moderate'),
+      'title' => t('User can moderate'),
       'handler' => 'workbench_moderation_handler_filter_user_can_moderate',
       'label' => t('Can moderate'),
     ),
@@ -199,11 +199,11 @@
   );
   $data['node']['workbench_moderation_history_link'] = array(
     'group' => t('Workbench Moderation'),
-    'title' => t('Moderation History'),
-    'help' => t('A link to the Moderation History page of the node'),
+    'title' => t('Moderation history'),
+    'help' => t('A link to the moderation history page of the node'),
     'real field' => 'nid',
     'field' => array(
-      'title' => t('Moderation History Link'),
+      'title' => t('Moderation history link'),
       'handler' => 'workbench_moderation_handler_field_history_link',
       'click sortable' => FALSE,
     ),
