$name = CRM_Utils_String::titleToVar(strtolower($fields['title']));
}
if (!CRM_Core_DAO::objectExists($name, 'CRM_Core_DAO_OptionGroup', $self->_id)) {
- $errors['title'] = ts('Option Group name ' . $name . ' already exists in the database. Option Group Names need to be unique');
+ $errors['title'] = ts("Option Group name '%1' already exists in the database. Option Group Names must be unique.", [1 => $name]);
}
return empty($errors) ? TRUE : $errors;
}
// Description
if (!empty($description[2]) && trim($description[2])) {
- $this->_qill[$grouping][] = ts('Relationship description - ' . $description[2]);
+ $this->_qill[$grouping][] = ts('Relationship description - %1', [1 => $description[2]]);
$description = CRM_Core_DAO::escapeString(trim($description[2]));
$where[$grouping][] = "civicrm_relationship.description LIKE '%{$description}%'";
}
$financialAccountType = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialAccount', $financialTypeAccount->financial_account_id, 'financial_account_type_id');
if (CRM_Utils_Array::value($financialTypeAccount->account_relationship, $financialAccountLinks) != $financialAccountType) {
$accountRelationships = CRM_Core_PseudoConstant::get('CRM_Financial_DAO_EntityFinancialAccount', 'account_relationship');
- $params = [
- 1 => $accountRelationships[$financialTypeAccount->account_relationship],
- ];
- throw new CRM_Core_Exception(ts("This financial account cannot have '%1' relationship.", $params));
+ throw new CRM_Core_Exception(ts("This financial account cannot have '%1' relationship.", [1 => $accountRelationships[$financialTypeAccount->account_relationship]]));
}
}
'now', $excludeIsAdmin, $params['membership_type_id'] ?? NULL, $params
);
if (empty($calcStatus)) {
- throw new CRM_Core_Exception(ts("The membership cannot be saved because the status cannot be calculated for start_date: {$params['start_date']} end_date {$params['end_date']} join_date {$params['join_date']} as at " . CRM_Utils_Time::date('Y-m-d H:i:s')));
+ throw new CRM_Core_Exception(ts("The membership cannot be saved because the status cannot be calculated for start_date: %1, end_date: %2, join_date: %3. Current time is: %4.", [1 => $params['start_date'], 2 => $params['end_date'], 3 => $params['join_date'], 4 => CRM_Utils_Time::date('Y-m-d H:i:s')]));
}
$params['status_id'] = $calcStatus['id'];
}
// 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'
- ) {
+ if (CRM_Utils_Array::value('contribution_or_soft_value', $this->_params) == 'contributions_only') {
$title = '%1 contributions: %2';
}
- elseif (CRM_Utils_Array::value('contribution_or_soft_value', $this->_params) ==
- 'soft_credits_only'
- ) {
+ elseif (CRM_Utils_Array::value('contribution_or_soft_value', $this->_params) == 'soft_credits_only') {
$title = '%1 soft-credits: %2';
}
foreach ($totals as $key => $total) {
}
$fieldMap[ts('Soft Credit')] = 'soft_credit';
$fieldMap[ts('Pledge Payment')] = 'pledge_payment';
- $fieldMap[ts(ts('Pledge ID'))] = 'pledge_id';
- $fieldMap[ts(ts('Financial Type'))] = 'financial_type_id';
- $fieldMap[ts(ts('Payment Method'))] = 'payment_instrument_id';
+ $fieldMap[ts('Pledge ID')] = 'pledge_id';
+ $fieldMap[ts('Financial Type')] = 'financial_type_id';
+ $fieldMap[ts('Payment Method')] = 'payment_instrument_id';
$fieldMap[ts('- do not import -')] = 'do_not_import';
// Membership fields
if ($addressOptions['street_address_parsing']) {
if (!CRM_Core_BAO_Address::isSupportedParsingLocale()) {
$config = CRM_Core_Config::singleton();
+ $url_address = CRM_Utils_System::url('civicrm/admin/setting/preferences/address', 'reset=1');
+ $url_localization = CRM_Utils_System::url('civicrm/admin/setting/localization', 'reset=1');
$messages[] = new CRM_Utils_Check_Message(
__FUNCTION__,
- ts(
- '<a href=' .
- CRM_Utils_System::url('civicrm/admin/setting/preferences/address', 'reset=1') .
- '">Street address parsing</a> is enabled but not supported by <a href="' .
- CRM_Utils_System::url('civicrm/admin/setting/localization', 'reset=1') .
- '">your locale</a> (%1).',
- [1 => $config->lcMessages]
- ),
+ ts('<a %1>Street address parsing</a> is enabled but not supported by <a %2>your language settings</a> (%3).', [1 => "href='$url_address'", 2 => "href='$url_localization'", 3 => $config->lcMessages]),
ts('Street address parsing'),
\Psr\Log\LogLevel::WARNING,
'fa-address-card'
}
$messages[] = new CRM_Utils_Check_Message(
__FUNCTION__ . "missingroles",
- ts("<p>The following roles listed in your case type definitions do not match any relationship type defined in the system: <em>%1</em>.</p>"
- . "<p>This might be because of a mismatch if you are using external xml files to manage case types. If using xml files, then use either the name_a_b or name_b_a value from the following table. (Out of the box you would use name_b_a, which lists them on the case from the client perspective.) If you are not using xml files, you can edit your case types at Administer - CiviCase - Case Types.</p>"
- . "<table>
- <tr><th>ID</th><th>name_a_b</th><th>name_b_a</th><th>label_a_b</th><th>label_b_a</th></tr>"
+ '<p>' . ts("The following roles listed in your case type definitions do not match any relationship type defined in the system: <em>%1</em>.", [1 => htmlspecialchars(implode(', ', $missing))]) . '</p>'
+ . "<p>" . ts("This might be because of a mismatch if you are using external xml files to manage case types. If using xml files, then use either the name_a_b or name_b_a value from the following table. (Out of the box you would use name_b_a, which lists them on the case from the client perspective.) If you are not using xml files, you can edit your case types at Administer - CiviCase - Case Types.") . '</p>'
+ . '<table>'
+ . '<tr><th>ID</th><th>name_a_b</th><th>name_b_a</th><th>label_a_b</th><th>label_b_a</th></tr>'
. implode("\n", $tableRows)
- . "</table>", [
- 1 => htmlspecialchars(implode(', ', $missing)),
- ]) .
- '<br /><a href="' . CRM_Utils_System::docURL2('user/case-management/what-you-need-to-know#missing-roles', TRUE) . '">' .
- ts('Read more about this warning') .
- '</a>',
+ . '</table>'
+ . '<br /><a href="' . CRM_Utils_System::docURL2('user/case-management/what-you-need-to-know#missing-roles', TRUE) . '">'
+ . ts('Read more about this warning')
+ . '</a>',
ts('Missing Roles'),
\Psr\Log\LogLevel::ERROR,
'fa-exclamation'
'action' => 'browse',
'sid' => $dao->ps_id,
]);
- $html .= "<tr><td>$dao->ps_title</td><td>$dao->psf_label</td><td><a href='$url'>View Price Set Fields</a></td></tr>";
+ $html .= "<tr><td>$dao->ps_title</td><td>$dao->psf_label</td><td><a href='$url'>" . ts('View Price Set Fields') . '</a></td></tr>';
}
if ($count > 0) {
- $msg = "<p>the following Price Set Fields use disabled or invalid financial types and need to be fixed if they are to still be used.<p>
- <p><table><thead><tr><th>Price Set</th><th>Price Set Field</th><th>Action Link</th>
- </tr></thead><tbody>
- $html
- </tbody></table></p>";
+ $msg = '<p>' . ts('The following Price Set Fields use disabled or invalid financial types and need to be fixed if they are to still be used.') . '<p>'
+ . '<p><table><thead><tr><th>' . ts('Price Set') . '</th><th>' . ts('Price Set Field') . '</th><th>' . ts('Action') . '</th>'
+ . '</tr></thead><tbody>'
+ . $html
+ . '</tbody></table></p>';
$messages[] = new CRM_Utils_Check_Message(
__FUNCTION__,
- ts($msg),
+ $msg,
ts('Invalid Price Fields'),
\Psr\Log\LogLevel::WARNING,
'fa-lock'
$html .= "<tr><td>{$tableName}</td><td>{$index['name']}</td><td>$fields</td>";
}
}
- $message = "<p>The following tables have missing indices. Click 'Update Indices' button to create them.<p>
- <p><table><thead><tr><th>Table Name</th><th>Key Name</th><th>Expected Indices</th>
- </tr></thead><tbody>
- $html
- </tbody></table></p>";
+ $message = '<p>' . ts("The following tables have missing indices. Click 'Update Indices' button to create them.") . '<p>'
+ . '<p><table><thead><tr><th>' . ts('Table Name') . '</th><th>' . ts('Key Name') . '</th><th>' . ts('Expected Indices') . '</th>'
+ . '</tr></thead><tbody>'
+ . $html
+ . '</tbody></table></p>';
$msg = new CRM_Utils_Check_Message(
__FUNCTION__,
- ts($message),
+ $message,
ts('Performance warning: Missing indices'),
\Psr\Log\LogLevel::WARNING,
'fa-server'
$log_url = implode($filePathMarker, $url);
if ($this->fileExists($log_url)) {
$docs_url = $this->createDocUrl('the-log-file-should-not-be-accessible');
- $msg = 'The <a href="%1">CiviCRM debug log</a> should not be downloadable.'
- . '<br />' .
- '<a href="%2">Read more about this warning</a>';
+ $msg = ts('The <a %1>CiviCRM debug log</a> should not be downloadable.', [1 => "href='$log_url'"])
+ . '<br />'
+ . '<a href="' . $docs_url . '">' . ts('Read more about this warning') . '</a>';
$messages[] = new CRM_Utils_Check_Message(
__FUNCTION__,
- ts($msg, [1 => $log_url, 2 => $docs_url]),
+ $msg,
ts('Security Warning'),
\Psr\Log\LogLevel::WARNING,
'fa-lock'
'Color',
];
if (!in_array($type, $possibleTypes)) {
- throw new CRM_Core_Exception(ts('Invalid type, must be one of : ' . implode($possibleTypes)));
+ throw new CRM_Core_Exception('Invalid type, must be one of : ' . implode($possibleTypes));
}
switch ($type) {
case 'Integer':