From d1401e862e6b6db653b7b1d3a588a60959209a6d Mon Sep 17 00:00:00 2001 From: Mathieu Lutfy Date: Mon, 7 Oct 2013 07:38:54 -0400 Subject: [PATCH] Fix ts() usage. --- CRM/Batch/Form/Entry.php | 2 +- CRM/Campaign/Form/Petition.php | 6 ++-- CRM/Upgrade/Incremental/php/FourFour.php | 10 +++--- CRM/Upgrade/Incremental/php/FourThree.php | 38 +++++++++++------------ CRM/Upgrade/Incremental/php/FourTwo.php | 12 +++---- templates/CRM/Admin/Form/LabelFormats.tpl | 12 ++----- 6 files changed, 37 insertions(+), 43 deletions(-) diff --git a/CRM/Batch/Form/Entry.php b/CRM/Batch/Form/Entry.php index c39d37a22b..ecc6043df9 100644 --- a/CRM/Batch/Form/Entry.php +++ b/CRM/Batch/Form/Entry.php @@ -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'])) { diff --git a/CRM/Campaign/Form/Petition.php b/CRM/Campaign/Form/Petition.php index 812a3281af..76a5fa775d 100644 --- a/CRM/Campaign/Form/Petition.php +++ b/CRM/Campaign/Form/Petition.php @@ -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; } diff --git a/CRM/Upgrade/Incremental/php/FourFour.php b/CRM/Upgrade/Incremental/php/FourFour.php index df30f2d264..2886e4f94d 100644 --- a/CRM/Upgrade/Incremental/php/FourFour.php +++ b/CRM/Upgrade/Incremental/php/FourFour.php @@ -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 .= '
' . ts("The setting to skip IDS check has been deprecated. Please use the permission 'skip IDS check' to bypass the IDS system"); + $postUpgradeMessage .= '
' . 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'); } /** diff --git a/CRM/Upgrade/Incremental/php/FourThree.php b/CRM/Upgrade/Incremental/php/FourThree.php index ea941668a6..679de0d23d 100644 --- a/CRM/Upgrade/Incremental/php/FourThree.php +++ b/CRM/Upgrade/Incremental/php/FourThree.php @@ -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 diff --git a/CRM/Upgrade/Incremental/php/FourTwo.php b/CRM/Upgrade/Incremental/php/FourTwo.php index b96699c91f..22eb06def5 100644 --- a/CRM/Upgrade/Incremental/php/FourTwo.php +++ b/CRM/Upgrade/Incremental/php/FourTwo.php @@ -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 diff --git a/templates/CRM/Admin/Form/LabelFormats.tpl b/templates/CRM/Admin/Form/LabelFormats.tpl index 0aa63e5b0c..1aa838686d 100644 --- a/templates/CRM/Admin/Form/LabelFormats.tpl +++ b/templates/CRM/Admin/Form/LabelFormats.tpl @@ -29,9 +29,7 @@ {if $action eq 8}
- {ts 1=$formatName}WARNING: You are about to delete the Label Format titled - %1 - .{/ts} {ts}Do you want to continue?{/ts} + {ts 1=$formatName}WARNING: You are about to delete the Label Format titled %1.{/ts} {ts}Do you want to continue?{/ts}
{elseif $action eq 16384}
@@ -111,12 +109,8 @@ {$form.weight.label} - {$form.weight.html}
- {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}
+ {$form.weight.html} +
{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}
{/if} -- 2.25.1