You are here

public function ParserOperationForm::getSuccessMessage in Markdown 8.2

Retrieves the success message to show after the operation has finished.

Return value

\Drupal\Core\StringTranslation\TranslatableMarkup The success message.

1 call to ParserOperationForm::getSuccessMessage()
ParserOperationForm::executeOperation in src/Form/ParserOperationForm.php
Controller for the "markdown.parser.operation" route.

File

src/Form/ParserOperationForm.php, line 129

Class

ParserOperationForm
Provides a confirmation form to disable a parser.

Namespace

Drupal\markdown\Form

Code

public function getSuccessMessage() {
  $variables = [
    '@action' => substr($this->operation, -1, 1) === 'e' ? $this
      ->t($this->operation . 'd') : $this->operation . 'ed',
    '@operation' => $this->operation,
    '%parser' => $this->parser
      ->getLabel(FALSE),
    '@parser_id' => $this->parser
      ->getPluginId(),
  ];
  switch ($this->operation) {
    case 'default':
      return $this
        ->t('%parser was set as the default markdown parser.', $variables);
  }
  return $this
    ->t('The markdown parser %parser was @action.', $variables);
}