public function Translator::checkAvailable

Checks whether a translator is available.

Return value

\Drupal\tmgmt\Translator\AvailableResult TRUE if the translator plugin is available, FALSE otherwise.

Overrides TranslatorInterface::checkAvailable

File

src/Entity/Translator.php, line 381

Class

Translator
Entity class for the tmgmt_translator entity.

Namespace

Drupal\tmgmt\Entity

Code

public function checkAvailable() {
  if ($plugin = $this
    ->getPlugin()) {
    return $plugin
      ->checkAvailable($this);
  }
  return AvailableResult::no(t('@translator is not available. Make sure it is properly <a href=:configured>configured</a>.', [
    '@translator' => $this
      ->label(),
    ':configured' => $this
      ->toUrl()
      ->toString(),
  ]));
}