You are here

public static function RequestTranslationApproveForm::finishBatch in TMGMT Extension Suite 8

Finish batch method.

Parameters

$success:

$results:

$operations:

Return value

\Symfony\Component\HttpFoundation\RedirectResponse

File

src/Form/RequestTranslationApproveForm.php, line 400

Class

RequestTranslationApproveForm

Namespace

Drupal\tmgmt_extension_suit\Form

Code

public static function finishBatch($success, $results, $operations) {
  $type = 'status';
  if ($success) {
    $message = Drupal::translation()
      ->formatPlural(count($results), 'Translation request queued for one job. @return.', 'Translation request queued for @count jobs. @return.', [
      '@return' => Link::fromTextAndUrl(t('Return to "Sources" page'), Url::fromRoute('tmgmt.source_overview_default'))
        ->toString(),
    ]);
  }
  else {
    $type = 'error';
    $message = t('Finished with an error. @return', [
      '@return' => Link::fromTextAndUrl(t('Return to "Sources" page'), Url::fromRoute('tmgmt.source_overview_default'))
        ->toString(),
    ]);
  }
  drupal_set_message($message, $type);
}