You are here

public function GlobalLinkTranslatorUi::checkoutInfo in GlobalLink Connect for Drupal 8

Same name and namespace in other branches
  1. 8.2 src/GlobalLinkTranslatorUi.php \Drupal\globallink\GlobalLinkTranslatorUi::checkoutInfo()

Retrieves information about a translation job.

Services based translators with remote states should place a Poll button here to sync the job state.

Parameters

\Drupal\tmgmt\JobInterface $job: The translation job.

Overrides TranslatorPluginUiBase::checkoutInfo

File

src/GlobalLinkTranslatorUi.php, line 395
Contains Drupal\globallink\GlobalLinkTranslatorUi.

Class

GlobalLinkTranslatorUi
GlobalLink translator UI.

Namespace

Drupal\globallink

Code

public function checkoutInfo(JobInterface $job) {
  $form = [];
  if ($job
    ->isActive()) {
    $form['actions']['pull'] = [
      '#type' => 'submit',
      '#value' => t('Pull translations'),
      '#submit' => [
        [
          $this,
          'submitPullTranslations',
        ],
      ],
      '#weight' => -10,
    ];
  }
  return $form;
}