Fix ts() usage.
authorMathieu Lutfy <mathieu@bidon.ca>
Mon, 7 Oct 2013 11:38:54 +0000 (07:38 -0400)
committerMathieu Lutfy <mathieu@bidon.ca>
Mon, 7 Oct 2013 11:38:54 +0000 (07:38 -0400)
CRM/Batch/Form/Entry.php
CRM/Campaign/Form/Petition.php
CRM/Upgrade/Incremental/php/FourFour.php
CRM/Upgrade/Incremental/php/FourThree.php
CRM/Upgrade/Incremental/php/FourTwo.php
templates/CRM/Admin/Form/LabelFormats.tpl

index c39d37a22bf4bf003ba8cc9268edb74f1fb430a7..ecc6043df95713e35d404740e5bfe487f357e004 100644 (file)
@@ -257,7 +257,7 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form {
 
       //validate for soft credit fields
       if (CRM_Utils_Array::value($key, $params['soft_credit_contact_select_id']) && !CRM_Utils_Array::value($key, $params['soft_credit_amount'])) {
-        $errors["soft_credit_amount[$key]"] = ts('Please enter the soft credit amount');
+        $errors["soft_credit_amount[$key]"] = ts('Please enter the soft credit amount.');
       }
       if (!empty($params['soft_credit_amount']) && CRM_Utils_Array::value($key, $params['soft_credit_amount'])
         && CRM_Utils_Rule::cleanMoney(CRM_Utils_Array::value($key, $params['soft_credit_amount'])) > CRM_Utils_Rule::cleanMoney($value['total_amount'])) {
index 812a3281afc801ad2887254f0d70bf55ca87be3f..76a5fa775d95f64bb4fba8b1a1bfa017d596dbc1 100644 (file)
@@ -265,14 +265,14 @@ class CRM_Campaign_Form_Petition extends CRM_Core_Form {
       1 => array($fields['activity_type_id'], 'Integer'),
       2 => array($fields['title'], 'String'),
     );
-    $uniqueRule = ts('activity type');
+    $uniqueRuleErrorMessage = ts('This title is already associated with the selected activity type. Please specify a unique title.');
 
     if (empty($fields['campaign_id'])) {
       $where[] = 'campaign_id IS NULL';
     } else {
       $where[] = 'campaign_id = %3';
       $params[3] = array($fields['campaign_id'], 'Integer');        
-      $uniqueRule = ts('campaign and activity type');
+      $uniqueRuleErrorMessage = ts('This title is already associated with the selected campaign and activity type. Please specify a unique title.');
     }
 
     // Exclude current Petition row if UPDATE.
@@ -291,7 +291,7 @@ WHERE  $whereClause
 
     $result = CRM_Core_DAO::singleValueQuery($query, $params);
     if ($result >= 1) {
-      $errors['title'] = ts('This title is already associated with the selected %1. Please specify a unique title.', array(1 => $uniqueRule));
+      $errors['title'] = $uniqueRuleErrorMessage;
     }
     return empty($errors) ? TRUE : $errors;
   }
index df30f2d264addcd4058d739dc9e60453ad755891..2886e4f94d31e33b0bf24f2761327d48e620a092 100644 (file)
@@ -62,23 +62,23 @@ class CRM_Upgrade_Incremental_php_FourFour {
     if ($rev == '4.4.alpha1') {
       $config = CRM_Core_Config::singleton();
       if (!empty($config->useIDS)) {
-        $postUpgradeMessage .= '<br />' . ts("The setting to skip IDS check has been deprecated. Please use the permission 'skip IDS check' to bypass the IDS system");
+        $postUpgradeMessage .= '<br />' . ts("The setting to skip IDS check has been deprecated. Please use the permission 'skip IDS check' to bypass the IDS system.");
       }
     }
   }
 
   function upgrade_4_4_alpha1($rev) {
     // task to process sql
-    $this->addTask(ts('Upgrade DB to 4.4.alpha1: SQL'), 'task_4_4_x_runSql', $rev);
+    $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.4.alpha1')), 'task_4_4_x_runSql', $rev);
 
     // Consolidate activity contacts CRM-12274.
-    $this->addTask(ts('Consolidate activity contacts'), 'activityContacts');
+    $this->addTask('Consolidate activity contacts', 'activityContacts');
 
     return TRUE;
   }
 
   function upgrade_4_4_beta1($rev) {
-    $this->addTask(ts('Upgrade DB to 4.4.beta1: SQL'), 'task_4_4_x_runSql', $rev);
+    $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.4.beta1')), 'task_4_4_x_runSql', $rev);
 
     // add new 'data' column in civicrm_batch
     $query = 'ALTER TABLE civicrm_batch ADD data LONGTEXT NULL COMMENT "cache entered data"';
@@ -100,7 +100,7 @@ class CRM_Upgrade_Incremental_php_FourFour {
     $query = 'DELETE FROM civicrm_cache WHERE group_name = "batch entry"';
     CRM_Core_DAO::executeQuery($query);
 
-    $this->addTask(ts('Migrate custom word-replacements'), 'wordReplacements');
+    $this->addTask('Migrate custom word-replacements', 'wordReplacements');
   }
 
   /**
index ea941668a6d7d6bb4f339fb1410db7798dca4d43..679de0d23dc10912de51c92cf91c6f8f1d295876 100644 (file)
@@ -209,14 +209,14 @@ WHERE ccp.financial_type_id IS NULL and cp.cost > 0');
 
     // add indexes for civicrm_entity_financial_trxn
     // CRM-12141
-    $this->addTask(ts('Check/Add indexes for civicrm_entity_financial_trxn'), 'task_4_3_x_checkIndexes', $rev);
+    $this->addTask('Check/Add indexes for civicrm_entity_financial_trxn', 'task_4_3_x_checkIndexes', $rev);
     // task to process sql
-    $this->addTask(ts('Upgrade DB to 4.3.alpha1: SQL'), 'task_4_3_x_runSql', $rev);
+    $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.3.alpha1')), 'task_4_3_x_runSql', $rev);
 
     //CRM-11636
-    $this->addTask(ts('Populate financial type values for price records'), 'assignFinancialTypeToPriceRecords');
+    $this->addTask('Populate financial type values for price records', 'assignFinancialTypeToPriceRecords');
     //CRM-11514 create financial records for contributions
-    $this->addTask(ts('Create financial records for contributions'), 'createFinancialRecords');
+    $this->addTask('Create financial records for contributions', 'createFinancialRecords');
 
     $minId = CRM_Core_DAO::singleValueQuery('SELECT coalesce(min(id),0) FROM civicrm_contact');
     $maxId = CRM_Core_DAO::singleValueQuery('SELECT coalesce(max(id),0) FROM civicrm_contact');
@@ -234,7 +234,7 @@ WHERE ccp.financial_type_id IS NULL and cp.cost > 0');
     }
 
     // Update phones CRM-11292.
-    $this->addTask(ts('Upgrade Phone Numbers'), 'phoneNumeric');
+    $this->addTask('Upgrade Phone Numbers', 'phoneNumeric');
 
     return TRUE;
   }
@@ -245,15 +245,15 @@ WHERE ccp.financial_type_id IS NULL and cp.cost > 0');
     if ($isColumnPresent) {
       CRM_Core_DAO::executeQuery('ALTER TABLE civicrm_dedupe_rule_group DROP COLUMN is_default');
     }
-    $this->addTask(ts('Upgrade DB to 4.3.alpha2: SQL'), 'task_4_3_x_runSql', $rev);
+    $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.3.alpha2')), 'task_4_3_x_runSql', $rev);
   }
 
   function upgrade_4_3_alpha3($rev) {
-    $this->addTask(ts('Upgrade DB to 4.3.alpha3: SQL'), 'task_4_3_x_runSql', $rev);
+    $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.3.alpha3')), 'task_4_3_x_runSql', $rev);
   }
 
   function upgrade_4_3_beta2($rev) {
-    $this->addTask(ts('Upgrade DB to 4.3.beta2: SQL'), 'task_4_3_x_runSql', $rev);
+    $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.3.beta2')), 'task_4_3_x_runSql', $rev);
 
     // CRM-12002
     if (
@@ -265,7 +265,7 @@ WHERE ccp.financial_type_id IS NULL and cp.cost > 0');
   }
 
   function upgrade_4_3_beta3($rev) {
-    $this->addTask(ts('Upgrade DB to 4.3.beta3: SQL'), 'task_4_3_x_runSql', $rev);
+    $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.3.beta3')), 'task_4_3_x_runSql', $rev);
     // CRM-12065
     $query = "SELECT id, form_values FROM civicrm_report_instance WHERE form_values LIKE '%contribution_type%'";
     $this->addTask('Replace contribution_type to financial_type in table civicrm_report_instance', 'replaceContributionTypeId', $query, 'reportInstance');
@@ -274,10 +274,10 @@ WHERE ccp.financial_type_id IS NULL and cp.cost > 0');
   }
 
   function upgrade_4_3_beta4($rev) {
-    $this->addTask(ts('Upgrade DB to 4.3.beta4: SQL'), 'task_4_3_x_runSql', $rev);
+    $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.3.beta4')), 'task_4_3_x_runSql', $rev);
     // add indexes for civicrm_entity_financial_trxn
     // CRM-12141
-    $this->addTask(ts('Check/Add indexes for civicrm_entity_financial_trxn'), 'task_4_3_x_checkIndexes', $rev);
+    $this->addTask('Check/Add indexes for civicrm_entity_financial_trxn', 'task_4_3_x_checkIndexes', $rev);
   }
 
   function upgrade_4_3_beta5($rev) {
@@ -301,11 +301,11 @@ ADD COLUMN   premiums_nothankyou_label varchar(255) COLLATE utf8_unicode_ci DEFA
 ";
       CRM_Core_DAO::executeQuery($query, array(), TRUE, NULL, FALSE, FALSE);
     }
-    $this->addTask(ts('Upgrade DB to 4.3.beta5: SQL'), 'task_4_3_x_runSql', $rev);
+    $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.3.beta5')), 'task_4_3_x_runSql', $rev);
   }
 
   function upgrade_4_3_4($rev) {
-    $this->addTask(ts('Upgrade DB to 4.3.4: SQL'), 'task_4_3_x_runSql', $rev);
+    $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.3.4')), 'task_4_3_x_runSql', $rev);
   }
 
   function upgrade_4_3_5($rev) {
@@ -330,19 +330,19 @@ ADD CONSTRAINT `FK_civicrm_financial_item_contact_id` FOREIGN KEY (`contact_id`)
 ";
       CRM_Core_DAO::executeQuery($query, array(), TRUE, NULL, FALSE, FALSE);
     }
-    $this->addTask(ts('Upgrade DB to 4.3.5: SQL'), 'task_4_3_x_runSql', $rev);
+    $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.3.5')), 'task_4_3_x_runSql', $rev);
   }
 
   function upgrade_4_3_6($rev) {
     //CRM-13094
-    $this->addTask(ts('Add mising contraints'), 'addMissingConstraints', $rev);
+    $this->addTask('Add mising contraints', 'addMissingConstraints', $rev);
     //CRM-13088
-    $this->addTask(ts('Add ON DELETE Options for constraints'), 'task_4_3_x_checkConstraints', $rev);
-    $this->addTask(ts('Upgrade DB to 4.3.6: SQL'), 'task_4_3_x_runSql', $rev);
+    $this->addTask('Add ON DELETE Options for constraints', 'task_4_3_x_checkConstraints', $rev);
+    $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.3.6')), 'task_4_3_x_runSql', $rev);
     // CRM-12844
     // update line_item, financial_trxn and financial_item table for recurring contributions
-    $this->addTask(ts('Update financial_account_id in financial_trxn table'), 'updateFinancialTrxnData', $rev);
-    $this->addTask(ts('Update Line Item Data'), 'updateLineItemData', $rev);
+    $this->addTask('Update financial_account_id in financial_trxn table', 'updateFinancialTrxnData', $rev);
+    $this->addTask('Update Line Item Data', 'updateLineItemData', $rev);
   }
   
   //CRM-11636
index b96699c91f7dcc2dea3a107648959bbc8a38e7de..22eb06def5c3057bc5ae20fa599e6b8609b66d39 100644 (file)
@@ -194,7 +194,7 @@ INNER JOIN civicrm_price_set cps ON cps.id = cpf.price_set_id AND cps.name <>'de
 
     // Some steps take a long time, so we break them up into separate
     // tasks and enqueue them separately.
-    $this->addTask(ts('Upgrade DB to 4.2.alpha1: SQL'), 'task_4_2_x_runSql', $rev);
+    $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.2.alpha1')), 'task_4_2_x_runSql', $rev);
     $this->addTask(ts('Upgrade DB to 4.2.alpha1: Price Sets'), 'task_4_2_alpha1_createPriceSets', $rev);
     self::convertContribution();
     $this->addTask(ts('Upgrade DB to 4.2.alpha1: Event Profile'), 'task_4_2_alpha1_eventProfile');
@@ -212,7 +212,7 @@ INNER JOIN civicrm_price_set cps ON cps.id = cpf.price_set_id AND cps.name <>'de
   }
 
   function upgrade_4_2_beta3($rev) {
-    $this->addTask(ts('Upgrade DB to 4.2.beta3: SQL'), 'task_4_2_x_runSql', $rev);
+    $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.2.beta3')), 'task_4_2_x_runSql', $rev);
     $minParticipantId = CRM_Core_DAO::singleValueQuery('SELECT coalesce(min(id),0) FROM civicrm_participant');
     $maxParticipantId = CRM_Core_DAO::singleValueQuery('SELECT coalesce(max(id),0) FROM civicrm_participant');
 
@@ -233,11 +233,11 @@ INNER JOIN civicrm_price_set cps ON cps.id = cpf.price_set_id AND cps.name <>'de
   }
 
   function upgrade_4_2_0($rev) {
-    $this->addTask(ts('Upgrade DB to 4.2.0: SQL'), 'task_4_2_x_runSql', $rev);
+    $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.2.0')), 'task_4_2_x_runSql', $rev);
   }
 
   function upgrade_4_2_2($rev) {
-    $this->addTask(ts('Upgrade DB to 4.2.2: SQL'), 'task_4_2_x_runSql', $rev);
+    $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.2.2')), 'task_4_2_x_runSql', $rev);
     //create line items for memberships and participants for api/import
     self::convertContribution();
 
@@ -274,7 +274,7 @@ INNER JOIN civicrm_price_set cps ON cps.id = cpf.price_set_id AND cps.name <>'de
   }
 
   function upgrade_4_2_3($rev) {
-    $this->addTask(ts('Upgrade DB to 4.2.3: SQL'), 'task_4_2_x_runSql', $rev);
+    $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.2.3')), 'task_4_2_x_runSql', $rev);
     // CRM-10953 Remove duplicate activity type for 'Reminder Sent' which is mistakenly inserted by 4.2.alpha1 upgrade script
     $queryMin = "
 SELECT coalesce(min(value),0) from civicrm_option_value ov
@@ -313,7 +313,7 @@ DELETE from civicrm_option_value
   }
 
   function upgrade_4_2_5($rev) {
-    $this->addTask(ts('Upgrade DB to 4.2.5: SQL'), 'task_4_2_x_runSql', $rev);
+    $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.2.5')), 'task_4_2_x_runSql', $rev);
     //CRM-11077
     $sql = " SELECT cpse.entity_id, cpse.price_set_id
 FROM `civicrm_price_set_entity` cpse
index 0aa63e5b0c6f11a8f7e0459a7c3ec0bd6262eea2..1aa838686d7b71f3b34007aca70ebc0c8f727642 100644 (file)
@@ -29,9 +29,7 @@
   {if $action eq 8}
     <div class="messages status no-popup">
       <div class="icon inform-icon"></div>
-      {ts 1=$formatName}WARNING: You are about to delete the Label Format titled
-        <strong>%1</strong>
-        .{/ts} {ts}Do you want to continue?{/ts}
+      {ts 1=$formatName}WARNING: You are about to delete the Label Format titled <strong>%1</strong>.{/ts} {ts}Do you want to continue?{/ts}
     </div>
   {elseif $action eq 16384}
     <div class="messages status no-popup">
       </tr>
       <tr class="crm-labelFormat-form-block-weight">
         <td class="right">{$form.weight.label}</td>
-        <td colspan="3">{$form.weight.html}<br/>
-          <span class="description">{ts}Weight controls the order in which Label Formats are displayed
-              <br/>
-              in selection lists. Enter a positive or negative integer. Lower numbers
-              <br/>
-              are displayed ahead of higher numbers.{/ts}</span>
+        <td colspan="3">{$form.weight.html}
+          <div class="description">{ts}Weight controls the order in which Label Formats are displayed in selection lists. Enter a positive or negative integer. Lower numbers are displayed ahead of higher numbers.{/ts}</div>
       </tr>
     </table>
   {/if}