From 1836ab9ebef1a2924241bc5fc0f86812628b17cc Mon Sep 17 00:00:00 2001 From: Mathieu Lutfy Date: Thu, 6 Jun 2019 16:51:36 -0400 Subject: [PATCH] Misc translation 'ts' fixes --- CRM/Contact/BAO/Relationship.php | 2 +- CRM/Contact/Form/Merge.php | 2 +- CRM/Contact/Form/Search/Criteria.php | 2 +- CRM/Contact/Form/Task/AddToParentClass.php | 2 +- CRM/Core/DAO/CustomField.php | 4 +-- CRM/Core/Exception.php | 2 +- CRM/Core/Form/Task/Batch.php | 6 ++-- CRM/Core/Payment/Form.php | 2 +- CRM/Core/Payment/PaymentExpressIPN.php | 4 +-- CRM/Report/Form.php | 36 +++++++++++----------- 10 files changed, 31 insertions(+), 31 deletions(-) diff --git a/CRM/Contact/BAO/Relationship.php b/CRM/Contact/BAO/Relationship.php index 909e321134..4898e7f204 100644 --- a/CRM/Contact/BAO/Relationship.php +++ b/CRM/Contact/BAO/Relationship.php @@ -1774,7 +1774,7 @@ SELECT count(*) $membershipValues['status_id'] = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipStatus', 'Expired', 'id', 'label'); $type = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType', $membershipValues['membership_type_id'], 'name', 'id'); CRM_Member_BAO_Membership::add($membershipValues); - CRM_Core_Session::setStatus(ts("Inherited membership {$type} status was changed to Expired due to the change in relationship type."), ts('Record Updated'), 'alert'); + CRM_Core_Session::setStatus(ts("Inherited membership %1 status was changed to Expired due to the change in relationship type.", [1 => $type]), ts('Record Updated'), 'alert'); } } } diff --git a/CRM/Contact/Form/Merge.php b/CRM/Contact/Form/Merge.php index 1434c173f6..91f282f6bb 100644 --- a/CRM/Contact/Form/Merge.php +++ b/CRM/Contact/Form/Merge.php @@ -245,7 +245,7 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form { ->readUserContext()); } catch (CRM_Core_Exception $e) { - CRM_Core_Error::statusBounce(ts($e->getMessage())); + CRM_Core_Error::statusBounce($e->getMessage()); } } diff --git a/CRM/Contact/Form/Search/Criteria.php b/CRM/Contact/Form/Search/Criteria.php index a22d9a95ec..7ce75635f7 100644 --- a/CRM/Contact/Form/Search/Criteria.php +++ b/CRM/Contact/Form/Search/Criteria.php @@ -89,7 +89,7 @@ class CRM_Contact_Form_Search_Criteria { // we will hide searching contact by attachments tags until it will be implemented in core if (count($tags) && $key != 'civicrm_file' && $key != 'civicrm_contact') { //if tags exists then add type to display in adv search form help text - $tagsTypes[] = ts($value); + $tagsTypes[] = $value; $showAllTagTypes = TRUE; } } diff --git a/CRM/Contact/Form/Task/AddToParentClass.php b/CRM/Contact/Form/Task/AddToParentClass.php index 9dd59c403f..2895b7a7f8 100644 --- a/CRM/Contact/Form/Task/AddToParentClass.php +++ b/CRM/Contact/Form/Task/AddToParentClass.php @@ -80,7 +80,7 @@ class CRM_Contact_Form_Task_AddToParentClass extends CRM_Contact_Form_Task { $this->assign('searchCount', $searchCount); $this->assign('searchDone', $this->get('searchDone')); - $this->assign('contact_type_display', ts($contactType)); + $this->assign('contact_type_display', $contactType); $this->addElement('submit', $this->getButtonName('refresh'), ts('Search'), ['class' => 'crm-form-submit']); $this->addElement('submit', $this->getButtonName('cancel'), ts('Cancel'), ['class' => 'crm-form-submit']); $this->addButtons([ diff --git a/CRM/Core/DAO/CustomField.php b/CRM/Core/DAO/CustomField.php index 4e873afa0b..573ac27fa0 100644 --- a/CRM/Core/DAO/CustomField.php +++ b/CRM/Core/DAO/CustomField.php @@ -586,7 +586,7 @@ class CRM_Core_DAO_CustomField extends CRM_Core_DAO { 'name' => 'note_columns', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Field Note Columns'), - 'description' => ts(' Number of columns in Note Field '), + 'description' => ts('Number of columns in Note Field'), 'where' => 'civicrm_custom_field.note_columns', 'table_name' => 'civicrm_custom_field', 'entity' => 'CustomField', @@ -597,7 +597,7 @@ class CRM_Core_DAO_CustomField extends CRM_Core_DAO { 'name' => 'note_rows', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Field Note Rows'), - 'description' => ts(' Number of rows in Note Field '), + 'description' => ts('Number of rows in Note Field'), 'where' => 'civicrm_custom_field.note_rows', 'table_name' => 'civicrm_custom_field', 'entity' => 'CustomField', diff --git a/CRM/Core/Exception.php b/CRM/Core/Exception.php index f87deadb83..bafcb72355 100644 --- a/CRM/Core/Exception.php +++ b/CRM/Core/Exception.php @@ -49,7 +49,7 @@ class CRM_Core_Exception extends PEAR_Exception { * @param null $previous */ public function __construct($message, $error_code = 0, $errorData = [], $previous = NULL) { - parent::__construct(ts($message)); + parent::__construct($message); $this->errorData = $errorData + ['error_code' => $error_code]; } diff --git a/CRM/Core/Form/Task/Batch.php b/CRM/Core/Form/Task/Batch.php index 2e86f420ff..fe3a2deb55 100644 --- a/CRM/Core/Form/Task/Batch.php +++ b/CRM/Core/Form/Task/Batch.php @@ -133,7 +133,7 @@ class CRM_Core_Form_Task_Batch extends CRM_Core_Form_Task { $this->addButtons([ [ 'type' => 'submit', - 'name' => ts('Update ' . ucfirst($this::$entityShortname) . 's)'), + 'name' => ts('Update'), 'isDefault' => TRUE, ], [ @@ -175,10 +175,10 @@ class CRM_Core_Form_Task_Batch extends CRM_Core_Form_Task { // don't set the status message when form is submitted. $buttonName = $this->controller->getButtonName('submit'); if ($suppressFields && $buttonName != '_qf_Batch_next') { - CRM_Core_Session::setStatus(ts("File type field(s) in the selected profile are not supported for Update multiple %1s", [1 => $this::$entityShortname]), ts('Unsupported Field Type'), 'error'); + CRM_Core_Session::setStatus(ts("File type fields in the selected profile are not supported for Update multiple %1s", [1 => $this::$entityShortname]), ts('Unsupported Field Type'), 'error'); } - $this->addDefaultButtons(ts('Update ' . ucfirst($this::$entityShortname) . 's')); + $this->addDefaultButtons(ts('Update')); $taskComponent['lc'] = $this::$entityShortname; $taskComponent['ucfirst'] = ucfirst($this::$entityShortname); diff --git a/CRM/Core/Payment/Form.php b/CRM/Core/Payment/Form.php index 75be45698a..3c6d3f897f 100644 --- a/CRM/Core/Payment/Form.php +++ b/CRM/Core/Payment/Form.php @@ -319,7 +319,7 @@ class CRM_Core_Payment_Form { if (!empty($values['credit_card_type'])) { $processorCards = CRM_Financial_BAO_PaymentProcessor::getCreditCards($processorID); if (!empty($processorCards) && !in_array($values['credit_card_type'], $processorCards)) { - $errors['credit_card_type'] = ts('This procesor does not support credit card type ' . $values['credit_card_type']); + $errors['credit_card_type'] = ts('This processor does not support credit card type %1', [1 => $values['credit_card_type']]); } } if (!empty($values['credit_card_number']) && diff --git a/CRM/Core/Payment/PaymentExpressIPN.php b/CRM/Core/Payment/PaymentExpressIPN.php index 81d2e5ff38..207bc59a9b 100644 --- a/CRM/Core/Payment/PaymentExpressIPN.php +++ b/CRM/Core/Payment/PaymentExpressIPN.php @@ -307,8 +307,8 @@ class CRM_Core_Payment_PaymentExpressIPN extends CRM_Core_Payment_BaseIPN { if ($response = curl_exec($curl)) { $info = curl_getinfo($curl); if ($info['http_code'] < 200 || $info['http_code'] > 299) { - $log_message = "DPS error: HTTP %1 retrieving %2."; - CRM_Core_Error::fatal(ts($log_message, [1 => $info['http_code'], 2 => $info['url']])); + $log_message = "DPS error: HTTP {$info['http_code']} retrieving {$info['url']}."; + CRM_Core_Error::fatal($log_message); } else { fwrite($message_log, sprintf("\n\r%s:- %s\n", date("D M j G:i:s T Y"), $response)); diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php index f12c915cf7..ff0884b912 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -5632,13 +5632,13 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a $spec = [ $options['prefix'] . 'name' => [ - 'title' => ts($options['prefix_label'] . 'Address Name'), + 'title' => $options['prefix_label'] . ts('Address Name'), 'name' => 'name', 'is_fields' => TRUE, ], $options['prefix'] . 'street_number' => [ 'name' => 'street_number', - 'title' => ts($options['prefix_label'] . 'Street Number'), + 'title' => $options['prefix_label'] . ts('Street Number'), 'type' => 1, 'is_fields' => TRUE, ], @@ -5654,7 +5654,7 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a ], $options['prefix'] . 'street_name' => [ 'name' => 'street_name', - 'title' => ts($options['prefix_label'] . 'Street Name'), + 'title' => $options['prefix_label'] . ts('Street Name'), 'type' => 1, 'is_fields' => TRUE, 'is_filters' => TRUE, @@ -5662,30 +5662,30 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a 'is_order_bys' => TRUE, ], $options['prefix'] . 'street_address' => [ - 'title' => ts($options['prefix_label'] . 'Street Address'), + 'title' => $options['prefix_label'] . ts('Street Address'), 'name' => 'street_address', 'is_fields' => TRUE, 'is_filters' => TRUE, 'is_group_bys' => TRUE, ], $options['prefix'] . 'supplemental_address_1' => [ - 'title' => ts($options['prefix_label'] . 'Supplementary Address Field 1'), + 'title' => $options['prefix_label'] . ts('Supplementary Address Field 1'), 'name' => 'supplemental_address_1', 'is_fields' => TRUE, ], $options['prefix'] . 'supplemental_address_2' => [ - 'title' => ts($options['prefix_label'] . 'Supplementary Address Field 2'), + 'title' => $options['prefix_label'] . ts('Supplementary Address Field 2'), 'name' => 'supplemental_address_2', 'is_fields' => TRUE, ], $options['prefix'] . 'supplemental_address_3' => [ - 'title' => ts($options['prefix_label'] . 'Supplementary Address Field 3'), + 'title' => $options['prefix_label'] . ts('Supplementary Address Field 3'), 'name' => 'supplemental_address_3', 'is_fields' => TRUE, ], $options['prefix'] . 'street_number' => [ 'name' => 'street_number', - 'title' => ts($options['prefix_label'] . 'Street Number'), + 'title' => $options['prefix_label'] . ts('Street Number'), 'type' => 1, 'is_order_bys' => TRUE, 'is_filters' => TRUE, @@ -5693,12 +5693,12 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a ], $options['prefix'] . 'street_unit' => [ 'name' => 'street_unit', - 'title' => ts($options['prefix_label'] . 'Street Unit'), + 'title' => $options['prefix_label'] . ts('Street Unit'), 'type' => 1, 'is_fields' => TRUE, ], $options['prefix'] . 'city' => [ - 'title' => ts($options['prefix_label'] . 'City'), + 'title' => $options['prefix_label'] . ts('City'), 'name' => 'city', 'operator' => 'like', 'is_fields' => TRUE, @@ -5707,7 +5707,7 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a 'is_order_bys' => TRUE, ], $options['prefix'] . 'postal_code' => [ - 'title' => ts($options['prefix_label'] . 'Postal Code'), + 'title' => $options['prefix_label'] . ts('Postal Code'), 'name' => 'postal_code', 'type' => 1, 'is_fields' => TRUE, @@ -5716,7 +5716,7 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a 'is_order_bys' => TRUE, ], $options['prefix'] . 'postal_code_suffix' => [ - 'title' => ts($options['prefix_label'] . 'Postal Code Suffix'), + 'title' => $options['prefix_label'] . ts('Postal Code Suffix'), 'name' => 'postal_code', 'type' => 1, 'is_fields' => TRUE, @@ -5725,7 +5725,7 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a 'is_order_bys' => TRUE, ], $options['prefix'] . 'county_id' => [ - 'title' => ts($options['prefix_label'] . 'County'), + 'title' => $options['prefix_label'] . ts('County'), 'alter_display' => 'alterCountyID', 'name' => 'county_id', 'type' => CRM_Utils_Type::T_INT, @@ -5736,7 +5736,7 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a 'is_group_bys' => TRUE, ], $options['prefix'] . 'state_province_id' => [ - 'title' => ts($options['prefix_label'] . 'State/Province'), + 'title' => $options['prefix_label'] . ts('State/Province'), 'alter_display' => 'alterStateProvinceID', 'name' => 'state_province_id', 'type' => CRM_Utils_Type::T_INT, @@ -5747,7 +5747,7 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a 'is_group_bys' => TRUE, ], $options['prefix'] . 'country_id' => [ - 'title' => ts($options['prefix_label'] . 'Country'), + 'title' => $options['prefix_label'] . ts('Country'), 'alter_display' => 'alterCountryID', 'name' => 'country_id', 'is_fields' => TRUE, @@ -5759,19 +5759,19 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a ], $options['prefix'] . 'location_type_id' => [ 'name' => 'is_primary', - 'title' => ts($options['prefix_label'] . 'Location Type'), + 'title' => $options['prefix_label'] . ts('Location Type'), 'type' => CRM_Utils_Type::T_INT, 'is_fields' => TRUE, 'alter_display' => 'alterLocationTypeID', ], $options['prefix'] . 'id' => [ - 'title' => ts($options['prefix_label'] . 'ID'), + 'title' => $options['prefix_label'] . ts('ID'), 'name' => 'id', 'is_fields' => TRUE, ], $options['prefix'] . 'is_primary' => [ 'name' => 'is_primary', - 'title' => ts($options['prefix_label'] . 'Primary Address?'), + 'title' => $options['prefix_label'] . ts('Primary Address?'), 'type' => CRM_Utils_Type::T_BOOLEAN, 'is_fields' => TRUE, ], -- 2.25.1