From 58438e5bda1415f8867962219f81c8caa1f36928 Mon Sep 17 00:00:00 2001 From: Mathieu Lutfy Date: Mon, 16 Mar 2015 20:13:35 -0400 Subject: [PATCH] CRM-16119: Fix incorrect usages of ts(). --- CRM/Campaign/Form/Task/Interview.php | 3 +-- CRM/Campaign/Form/Task/Reserve.php | 2 +- CRM/Campaign/Page/AJAX.php | 2 +- CRM/Contact/Form/Edit/TagsAndGroups.php | 6 +++--- CRM/Contribute/Form/AdditionalPayment.php | 8 ++++---- CRM/Event/Form/ParticipantFeeSelection.php | 4 ++-- 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/CRM/Campaign/Form/Task/Interview.php b/CRM/Campaign/Form/Task/Interview.php index 649a423335..2954a9d80e 100755 --- a/CRM/Campaign/Form/Task/Interview.php +++ b/CRM/Campaign/Form/Task/Interview.php @@ -546,8 +546,7 @@ WHERE {$clause} $subject = ''; $surveyTitle = CRM_Utils_Array::value('surveyTitle', $params); if ($surveyTitle) { - $subject = ts('%1', array(1 => $surveyTitle)); - $subject .= ' - '; + $subject = $surveyTitle . ' - '; } $subject .= ts('Respondent Interview'); diff --git a/CRM/Campaign/Form/Task/Reserve.php b/CRM/Campaign/Form/Task/Reserve.php index 3fd757bfda..c843d3767d 100644 --- a/CRM/Campaign/Form/Task/Reserve.php +++ b/CRM/Campaign/Form/Task/Reserve.php @@ -253,7 +253,7 @@ class CRM_Campaign_Form_Task_Reserve extends CRM_Campaign_Form_Task { $reservedVoterIds = array(); foreach ($this->_contactIds as $cid) { - $subject = ts('%1', array(1 => $this->_surveyDetails['title'])) . ' - ' . ts('Respondent Reservation'); + $subject = $this->_surveyDetails['title'] . ' - ' . ts('Respondent Reservation'); $session = CRM_Core_Session::singleton(); $activityParams = array( 'source_contact_id' => $session->get('userID'), diff --git a/CRM/Campaign/Page/AJAX.php b/CRM/Campaign/Page/AJAX.php index 79a47cc4de..474b79e441 100644 --- a/CRM/Campaign/Page/AJAX.php +++ b/CRM/Campaign/Page/AJAX.php @@ -435,7 +435,7 @@ class CRM_Campaign_Page_AJAX { $surveytitle = $surveyValues['title']; } - $subject = ts('%1', array(1 => $surveytitle)) . ' - ' . ts('Respondent Reservation'); + $subject = $surveytitle . ' - ' . ts('Respondent Reservation'); $activityParams['subject'] = $subject; $activityParams['status_id'] = $scheduledStatusId; $activityParams['skipRecentView'] = 1; diff --git a/CRM/Contact/Form/Edit/TagsAndGroups.php b/CRM/Contact/Form/Edit/TagsAndGroups.php index 23c83cf6bd..72302f9a9d 100644 --- a/CRM/Contact/Form/Edit/TagsAndGroups.php +++ b/CRM/Contact/Form/Edit/TagsAndGroups.php @@ -70,8 +70,8 @@ class CRM_Contact_Form_Edit_TagsAndGroups { $type = self::ALL, $visibility = FALSE, $isRequired = NULL, - $groupName = 'Group(s)', - $tagName = 'Tag(s)', + $groupName = ts('Group(s)'), + $tagName = ts('Tag(s)'), $fieldName = NULL, $groupElementType = 'checkbox' ) { @@ -130,7 +130,7 @@ class CRM_Contact_Form_Edit_TagsAndGroups { } if ($groupElementType == 'select' && !empty($groupsOptions)) { - $form->add('select', $fName, ts('%1', array(1 => $groupName)), $groupsOptions, FALSE, + $form->add('select', $fName, $groupName, $groupsOptions, FALSE, array('id' => $fName, 'multiple' => 'multiple', 'class' => 'crm-select2') ); $form->assign('groupCount', count($groupsOptions)); diff --git a/CRM/Contribute/Form/AdditionalPayment.php b/CRM/Contribute/Form/AdditionalPayment.php index e25f046314..8a0d8990b2 100644 --- a/CRM/Contribute/Form/AdditionalPayment.php +++ b/CRM/Contribute/Form/AdditionalPayment.php @@ -264,9 +264,9 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract $attributes = CRM_Core_DAO::getAttribute('CRM_Financial_DAO_FinancialTrxn'); $this->add('select', 'payment_processor_id', ts('Payment Processor'), $this->_processors, NULL); - $label = ($this->_refund) ? 'Refund Amount' : 'Payment Amount'; + $label = ($this->_refund) ? ts('Refund Amount') : ts('Payment Amount'); $this->addMoney('total_amount', - ts('%1', array(1 => $label)), + $label, FALSE, $attributes['total_amount'], TRUE, 'currency', NULL @@ -289,8 +289,8 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract $this->add('textarea', 'receipt_text', ts('Confirmation Message')); // add various dates - $dateLabel = ($this->_refund) ? 'Refund Date' : 'Received Date'; - $this->addDateTime('trxn_date', ts('%1', array(1 => $dateLabel)), FALSE, array('formatType' => 'activityDateTime')); + $dateLabel = ($this->_refund) ? ts('Refund Date') : ts('Received Date'); + $this->addDateTime('trxn_date', $dateLabel, FALSE, array('formatType' => 'activityDateTime')); if ($this->_contactId && $this->_id) { if ($this->_component == 'event') { diff --git a/CRM/Event/Form/ParticipantFeeSelection.php b/CRM/Event/Form/ParticipantFeeSelection.php index 7aa096163b..a8ebbacccf 100644 --- a/CRM/Event/Form/ParticipantFeeSelection.php +++ b/CRM/Event/Form/ParticipantFeeSelection.php @@ -116,9 +116,9 @@ class CRM_Event_Form_ParticipantFeeSelection extends CRM_Core_Form { $this->assign('lineItemTotal', $lineItemTotal); } - $title = "Change selections for {$this->_contributorDisplayName}"; + $title = ts("Change selections for %1", array(1 => $this->_contributorDisplayName)); if ($title) { - CRM_Utils_System::setTitle(ts('%1', array(1 => $title))); + CRM_Utils_System::setTitle($title); } } -- 2.25.1