Index: recipe.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/recipe/recipe.module,v
retrieving revision 1.73
diff -u -r1.73 recipe.module
--- recipe.module	31 May 2007 22:53:12 -0000	1.73
+++ recipe.module	7 Jul 2007 15:05:19 -0000
@@ -33,7 +33,7 @@
  * Implementation of hook_perm().
  */
 function recipe_perm() {
-  return array('create recipes', 'edit own recipes');
+  return array(t('create recipes'), t('edit own recipes'));
 }
 
 /**
@@ -82,7 +82,7 @@
     'recipe' => array(
       'name' => t('Recipe'),
       'module' => 'recipe',
-      'description' => t("Share your favorite recipes with your fellow cooks."),
+      'description' => t('Share your favorite recipes with your fellow cooks.'),
     )
   );
 }
@@ -93,7 +93,7 @@
 function recipe_help($section) {
   switch ($section) {
     case 'node/add/recipe':
-      return variable_get("recipe_help", "");
+      return variable_get('recipe_help', '');
   }
 }
 
@@ -145,7 +145,7 @@
     '#default_value' => $node->body,
     '#cols' => 60,
     '#rows' => 2,
-    '#description' => 'A short description or "teaser" for the recipe.',
+    '#description' => t('A short description or "teaser" for the recipe.'),
     '#required' => TRUE,
   );
   $form['yield'] = array(
@@ -154,24 +154,24 @@
     '#default_value' => $node->yield,
     '#size' => 10,
     '#maxlength' => 10,
-    '#description' => 'The number of servings the recipe will make.',
+    '#description' => t('The number of servings the recipe will make.'),
     '#attributes' => NULL,
     '#required' => TRUE,
   );
   $form['preptime'] = array(
     '#type' => 'select',
-    '#title' => t("Preparation time"),
+    '#title' => t('Preparation time'),
     '#default_value' => $node->preptime,
-    '#options' => array (5 => "5 minutes", 10 => "10 minutes", 15 => "15 minutes", 20 => "20 minutes", 30 => "30 minutes", 45 => "45 minutes", 60 => "1 hour", 90 => "1 1/2 hours", 120 => "2 hours", 150 => "2 1/2 hours", 180 => "3 hours", 210 => "3 1/2 hours", 240 => "4 hours", 300 => "5 hours", 360 => "6 hours"),
-    '#description' => t("How long does this recipe take to prepare (i.e. elapsed time)"),
+    '#options' => array (5 => t('5 minutes'), 10 => t('10 minutes'), 15 => t('15 minutes'), 20 => t('20 minutes'), 30 => t('30 minutes'), 45 => t('45 minutes'), 60 => t('1 hour'), 90 => t('1 1/2 hours'), 120 => t('2 hours'), 150 => t('2 1/2 hours'), 180 => t('3 hours'), 210 => t('3 1/2 hours'), 240 => t('4 hours'), 300 => t('5 hours'), 360 => t('6 hours')),
+    '#description' => t('How long does this recipe take to prepare (i.e. elapsed time)'),
   );
   $form["source"] = array(
     '#type' => 'textfield',
-    '#title' => t("Source"),
+    '#title' => t('Source'),
     '#default_value' => $node->source,
     '#size' => 60,
     '#maxlength' => 127,
-    '#description' => t("Optional. Does anyone else deserve credit for this recipe?"),
+    '#description' => t('Optional. Does anyone else deserve credit for this recipe?'),
   );
 
   // Table of existing ingredients
@@ -179,12 +179,14 @@
   $system = variable_get('recipe_ingredient_system','complex');
   if ($system == 'complex') {
     $form['ingredients']['headings'] = array(
-      '#value' => '<div><table ><thead><tr><th>Quantity</th><th>Units</th><th>Ingredient Name</th></tr></thead>'."\n".'<tbody>',
+      '#value' => '<div><table ><thead><tr><th>'.t('Quantity').'</th><th>'.
+                  t('Units').'</th><th>'.t('Ingredient Name').
+                  '</th></tr></thead>'."\n".'<tbody>',
     );
   }
   else {
     $form['ingredients']['headings'] = array(
-      '#value' => '<div><table ><thead><tr><th>Ingredients</th></tr></thead>'."\n".'<tbody>',
+      '#value' => '<div><table ><thead><tr><th>'.t('Ingredients').'</th></tr></thead>'."\n".'<tbody>',
     );
   }
   $rows = array();
@@ -341,15 +343,15 @@
     '#default_value' => $node->instructions,
     '#cols' => 60,
     '#rows' => 10,
-    '#description' => 'Step by step instructions on how to prepare and cook the recipe.',
+    '#description' => t('Step by step instructions on how to prepare and cook the recipe.'),
   );
   $form['notes'] = array(
     '#type' => 'textarea',
-    '#title' => t("Additional Notes"),
+    '#title' => t('Additional Notes'),
     '#default_value' => $node->notes,
     '#cols' => 60,
     '#rows' => 5,
-    '#description' => t("Optional. Describe a great dining experience relating to this recipe, or note which wine or other dishes complement this recipe"),
+    '#description' => t('Optional. Describe a great dining experience relating to this recipe, or note which wine or other dishes complement this recipe'),
   );
   $form['filter'] = filter_form($node->format);
 
@@ -364,8 +366,8 @@
     '#type' => 'select',
     '#title' => t('Index Depth'),
     '#default_value' => variable_get('recipe_index_depth', 0),
-    '#options' => array(0 => "All Terms", 1 => "1", 2 => "2", 3 => "3", 4 => "4", 5 => "5", 6 => "6"),
-    '#description' => t("Defines how many levels of terms should be displayed on any given recipe index page. For example, if you select 1 then only one level of the Recipe index tree will be displayed at a time."),
+    '#options' => array(0 => t('All Terms'), 1 => "1", 2 => "2", 3 => "3", 4 => "4", 5 => "5", 6 => "6"),
+    '#description' => t('Defines how many levels of terms should be displayed on any given recipe index page. For example, if you select 1 then only one level of the Recipe index tree will be displayed at a time.'),
   );
   $form['recipe_recent_box_enable'] = array(
     '#type' => 'radios',
@@ -377,7 +379,7 @@
   );
   $form['recipe_recent_box_title'] = array(
     '#type' => 'textfield',
-    '#title' => 'Box Title',
+    '#title' => t('Box Title'),
     '#default_value' => variable_get('recipe_recent_box_title', t('Latest Recipes')),
     '#size' => 35,
     '#maxlength' => 255,
@@ -388,7 +390,7 @@
     '#title' => t('Recipes to Display'),
     '#default_value' => variable_get('recipe_recent_display', '5'),
     '#options' => array(5 => "5", 10 => "10", 15 => "15"),
-    '#description' => t("Sets the number of recent recipes that will be displayed in the Recent Recipes box. (0 = not displayed)."),
+    '#description' => t('Sets the number of recent recipes that will be displayed in the Recent Recipes box. (0 = not displayed).'),
   );
   $form['recipe_help'] = array(
     '#type' => 'textarea',
@@ -456,7 +458,7 @@
     );
     $items[] = array(
       'path' => 'recipe/ingredient/autocomplete',
-      'title' => 'Ingredient autocomplete',
+      'title' => t('Ingredient autocomplete'),
       'callback' => 'recipe_autocomplete_page',
       'type' => MENU_CALLBACK,
       'access' => user_access('access content')
@@ -469,7 +471,7 @@
     );
     $items[] = array(
       'path' => 'recipe/importolddb',
-      'title' => 'import old recipes',
+      'title' => t('import old recipes'),
       'callback' => 'recipe_import_from_46',
       'type' => MENU_SUGGESTED_ITEM,
       'access' => user_access('create recipes')
@@ -959,10 +961,10 @@
       $ingredient = recipe_parse_ingredient_string($ingredient->name);
     }
     if (check_plain($ingredient->name) != $ingredient->name) {
-      form_set_error("recipe", "Ingredient names must be plain text.");
+      form_set_error("recipe", t('Ingredient names must be plain text.'));
     }
     if ($ingredient->name && _in_array($ingredient,$ingredients)) {
-      form_set_error("recipe", "Duplicate ingredients are not allowed.");
+      form_set_error("recipe", t('Duplicate ingredients are not allowed.'));
     }
     else {
       $ingredients[] = $ingredient;
@@ -1443,18 +1445,18 @@
 
   // Construct the summary
   $summary = '<table>';
-  $summary .= '<tr><th>Yield</th><td>'.$yield.'</td></tr>';
+  $summary .= '<tr><th>'.t('Yield').'</th><td>'.$yield.'</td></tr>';
   if ($node->source) {
-    $summary .= '<tr><th>Source</th><td>'.$node->source.'</td></tr>';
+    $summary .= '<tr><th>'.t('Source').'</th><td>'.$node->source.'</td></tr>';
   }
   if ($node->preptime) {
     if ($node->preptime < 60) {
-      $preptime = t("@n minutes", array ("@n" => $node->preptime));
+      $preptime = format_plural($node->preptime, '1 minute', '@count minutes');
     }
     else {
-      $preptime = t("@n hours", array ("@n" => recipe_ingredient_quantity_from_decimal($node->preptime / 60)));
+      $preptime = format_plural(recipe_ingredient_quantity_from_decimal($node->preptime / 60), '1 hour', '@count hours');
     }
-     $summary .= '<tr><th>Prep Time</th><td>'.$preptime.'</td></tr>';
+     $summary .= '<tr><th>'.t('Prep Time').'</th><td>'.$preptime.'</td></tr>';
   }
   $vocabs = taxonomy_get_vocabularies('recipe');
   if (count($vocabs) > 0) {
