You are here

public function ContinuousManager::checkIfContinuousTranslatorAvailable in Translation Management Tool 8

Returns TRUE if there are translators that support continuous jobs.

File

src/ContinuousManager.php, line 169

Class

ContinuousManager
A service manager for continuous jobs.

Namespace

Drupal\tmgmt

Code

public function checkIfContinuousTranslatorAvailable() {
  $translator_plugins = $this->translatorManager
    ->getDefinitions();
  foreach ($translator_plugins as $type => $definition) {
    $translator_type = $this->translatorManager
      ->createInstance($type);
    if ($translator_type instanceof ContinuousTranslatorInterface) {
      return TRUE;
    }
  }
  return FALSE;
}