You are here

public function GoogleTranslator::checkAvailable in TMGMT Translator Google 8

Overrides TMGMTDefaultTranslatorPluginController::checkAvailable().

Overrides TranslatorPluginBase::checkAvailable

File

src/Plugin/tmgmt/Translator/GoogleTranslator.php, line 113
Contains \Drupal\tmgmt_microsoft\Plugin\tmgmt\Translator\MicrosoftTranslator.

Class

GoogleTranslator
Google translator plugin.

Namespace

Drupal\tmgmt_google\Plugin\tmgmt\Translator

Code

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