From 0161a899f059a71636d614af1acf3ee9840ea24d Mon Sep 17 00:00:00 2001 From: Mathieu Lutfy Date: Mon, 7 Oct 2013 12:32:45 -0400 Subject: [PATCH] Fix ts() usage. --- CRM/Event/Form/Registration/Register.php | 5 +++-- CRM/Financial/BAO/FinancialTypeAccount.php | 2 +- CRM/Mailing/Page/Tab.php | 2 +- CRM/Report/Form/Contribute/Detail.php | 13 +++++++------ 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/CRM/Event/Form/Registration/Register.php b/CRM/Event/Form/Registration/Register.php index 719a0a5a5c..b30edc7643 100644 --- a/CRM/Event/Form/Registration/Register.php +++ b/CRM/Event/Form/Registration/Register.php @@ -351,8 +351,9 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { if (!$this->_allowConfirmation || $this->_additionalParticipantIds) { // Hardcode maximum number of additional participants here for now. May need to make this configurable per event. // Label is value + 1, since the code sees this is ADDITIONAL participants (in addition to "self") - $additionalOptions = array('' => ts('1'), 1 => ts('2'), 2 => ts('3'), 3 => ts('4'), 4 => ts('5'), - 5 => ts('6'), 6 => ts('7'), 7 => ts('8'), 8 => ts('9'), 9 => ts('10'), + $additionalOptions = array( + '' => '1', 1 => '2', 2 => '3', 3 => '4', 4 => '5', + 5 => '6', 6 => '7', 7 => '8', 8 => '9', 9 => '10', ); $element = $this->add('select', 'additional_participants', ts('How many people are you registering?'), diff --git a/CRM/Financial/BAO/FinancialTypeAccount.php b/CRM/Financial/BAO/FinancialTypeAccount.php index 9fa29dc750..b90bdf3fe0 100644 --- a/CRM/Financial/BAO/FinancialTypeAccount.php +++ b/CRM/Financial/BAO/FinancialTypeAccount.php @@ -154,7 +154,7 @@ class CRM_Financial_BAO_FinancialTypeAccount extends CRM_Financial_DAO_EntityFin $financialType->id = $financialTypeAccountId; $financialType->find(TRUE); $financialType->delete(); - CRM_Core_Session::setStatus(ts('Unbalanced transactions may be created if you delete %1 account.', array(1 => $relationValues[$financialType->account_relationship]))); + CRM_Core_Session::setStatus(ts('Unbalanced transactions may be created if you delete the account of type: %1.', array(1 => $relationValues[$financialType->account_relationship]))); } /** diff --git a/CRM/Mailing/Page/Tab.php b/CRM/Mailing/Page/Tab.php index cab9b9ba05..7b6487b041 100644 --- a/CRM/Mailing/Page/Tab.php +++ b/CRM/Mailing/Page/Tab.php @@ -77,7 +77,7 @@ class CRM_Mailing_Page_Tab extends CRM_Contact_Page_View { CRM_Contact_Page_View::checkUserPermission($this); // set page title - CRM_Utils_System::setTitle(ts('Mailings sent to') . ' ' . $displayName); + CRM_Utils_System::setTitle(ts('Mailings sent to %1', array(1 => $displayName))); } /** diff --git a/CRM/Report/Form/Contribute/Detail.php b/CRM/Report/Form/Contribute/Detail.php index e70ed21ebb..b4c7cd1a46 100644 --- a/CRM/Report/Form/Contribute/Detail.php +++ b/CRM/Report/Form/Contribute/Detail.php @@ -882,17 +882,18 @@ WHERE civicrm_contribution_contribution_id={$row['civicrm_contribution_contribu } if ($showsumcontribs) { $totalandsum = array(); - $title = ts('contributions / soft-credits'); + // ts exception to avoid having ts("%1 %2: %3") + $title = '%1 contributions / soft-credits: %2'; + if (CRM_Utils_Array::value('contribution_or_soft_value', $this->_params) == 'contributions_only') { - $title = ts('contributions'); + $title = '%1 contributions: %2'; } else if (CRM_Utils_Array::value('contribution_or_soft_value', $this->_params) == 'soft_credits_only') { - $title = ts('soft-credits'); + $title = '%1 soft-credits: %2'; } foreach ($totals as $key => $total) { - $totalandsum[$key] = ts("%1 %2: %3", array( + $totalandsum[$key] = ts($title, array( 1 => $total, - 2 => $title, - 3 => CRM_Utils_Money::format($sumcontribs[$key]) + 2 => CRM_Utils_Money::format($sumcontribs[$key]) )); } $this->assign('sectionTotals', $totalandsum); -- 2.25.1