Skip to content
Snippets Groups Projects
Commit ab579eae authored by Pranali  Kalavadia's avatar Pranali Kalavadia Committed by saranya ashokkumar
Browse files

Issue #2992193 by Pranali.addweb, bhanuprakashnani, satwik_bhv1, sebby,...

Issue #2992193 by Pranali.addweb, bhanuprakashnani, satwik_bhv1, sebby, saranya ashokkumar: Convert t() to $this->t()
parent 63ef2fd3
No related branches found
No related tags found
No related merge requests found
......@@ -51,19 +51,19 @@ class WorkflowNotificationForm extends EntityForm {
];
$form['from_sid'] = [
'#type' => 'select',
'#title' => t('From state'),
'#title' => $this->t('From state'),
'#options' => $state_options,
'#default_value' => $workflow_notification->from_sid,
];
$form['to_sid'] = [
'#type' => 'select',
'#title' => t('To state'),
'#title' => $this->t('To state'),
'#options' => $state_options,
'#default_value' => $workflow_notification->to_sid,
];
$form['when_to_trigger'] = [
'#type' => 'radios',
'#title' => t('When to trigger'),
'#title' => $this->t('When to trigger'),
'#options' => [
'on_state_change' => t('On State change'),
'before_state_change' => t('Before State change'),
......@@ -79,7 +79,7 @@ class WorkflowNotificationForm extends EntityForm {
];
$form['days'] = [
'#type' => 'number',
'#title' => t('Days'),
'#title' => $this->t('Days'),
'#min' => 0,
'#default_value' => $workflow_notification->days,
'#description' => t('Enter the number of days before a transition is scheduled, a message must be sent.'),
......@@ -94,44 +94,44 @@ class WorkflowNotificationForm extends EntityForm {
];
$form['mail_to'] = [
'#type' => 'fieldset',
'#title' => t('Mail To'),
'#title' => $this->t('Mail To'),
'#collapsible' => TRUE,
];
$form['mail_to']['roles'] = [
'#type' => 'checkboxes',
'#options' => $role_options,
'#title' => t('Roles'),
'#title' => $this->t('Roles'),
'#default_value' => $workflow_notification->roles,
'#description' => t('Check each role that must be informed.'),
];
// @todo: add validation for email adresses.
$form['mail_to']['mail_ids'] = [
'#type' => 'textarea',
'#title' => t('Email adresses'),
'#title' => $this->t('Email adresses'),
'#default_value' => $workflow_notification->mail_ids ?? "",
'#description' => t('Enter a valid Email address, one per line.'),
];
$form['template'] = [
'#type' => 'fieldset',
'#title' => t('Template'),
'#title' => $this->t('Template'),
'#collapsible' => TRUE,
];
$form['template']['subject'] = [
'#type' => 'textfield',
'#title' => t('Subject'),
'#title' => $this->t('Subject'),
'#default_value' => $workflow_notification->subject ?? "",
'#required' => TRUE,
];
$form['template']['message'] = [
'#type' => 'text_format',
'#title' => t('Message'),
'#title' => $this->t('Message'),
'#default_value' => $workflow_notification->message['value'],
'#format' => $workflow_notification->message['format'],
'#required' => TRUE,
];
$form['note'] = [
'#type' => 'markup',
'#markup' => t("<b>Note:</b> Token can be available in the listed fields - MailID, Subject, Message"),
'#markup' => $this->t("<b>Note:</b> Token can be available in the listed fields - MailID, Subject, Message"),
];
// Token support.
......@@ -182,7 +182,7 @@ class WorkflowNotificationForm extends EntityForm {
$ids = array_filter(preg_split('/\r\n|[\r\n]/', $values));
foreach ($ids as $k => $id) {
if (!\Drupal::service('email.validator')->isValid($id)) {
$form_state->setErrorByName('mail_ids', t('The email address %mail is not valid.', ['%mail' => $id]));
$form_state->setErrorByName('mail_ids', $this->t('The email address %mail is not valid.', ['%mail' => $id]));
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment