You are here

private function RequestTranslationApproveForm::getConflictMessage in TMGMT Extension Suite 8

Returns conflicting items message.

Parameters

array $conflicting_items:

Return value

string

1 call to RequestTranslationApproveForm::getConflictMessage()
RequestTranslationApproveForm::submitForm in src/Form/RequestTranslationApproveForm.php
Form submission handler.

File

src/Form/RequestTranslationApproveForm.php, line 101

Class

RequestTranslationApproveForm

Namespace

Drupal\tmgmt_extension_suit\Form

Code

private function getConflictMessage(array $conflicting_items) {
  $list_render_array = [
    '#theme' => 'item_list',
    '#items' => $conflicting_items,
    '#type' => 'ul',
    '#attributes' => [
      'class' => 'dropped-job-item-list',
    ],
  ];
  $rendered_list = Drupal::service('renderer')
    ->render($list_render_array);
  $message = Drupal::translation()
    ->formatPlural(count($conflicting_items), '1 item conflicted with pending item and was skipped. Existing job item: @rendered_list', '@count items conflicted with pending items and were skipped. Existing job items: @rendered_list', [
    '@rendered_list' => $rendered_list,
  ]);
  return Markup::create($message);
}