You are here

public function GoogleTranslator::getSupportedTargetLanguages in TMGMT Translator Google 8

Overrides TMGMTDefaultTranslatorPluginController::getSupportedTargetLanguages().

Overrides TranslatorPluginBase::getSupportedTargetLanguages

File

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

Class

GoogleTranslator
Google translator plugin.

Namespace

Drupal\tmgmt_google\Plugin\tmgmt\Translator

Code

public function getSupportedTargetLanguages(TranslatorInterface $translator, $source_language) {
  $languages = $this
    ->getSupportedRemoteLanguages($translator);

  // There are no language pairs, any supported language can be translated
  // into the others. If the source language is part of the languages,
  // then return them all, just remove the source language.
  if (array_key_exists($source_language, $languages)) {
    unset($languages[$source_language]);
    return $languages;
  }
  return array();
}