public function TranslatorPluginBase::getSupportedLanguagePairs

Default implementation that gets target languages for each remote language. This approach is ineffective and therefore it is advised that a plugin should provide own implementation.

Overrides TranslatorPluginInterface::getSupportedLanguagePairs

File

src/TranslatorPluginBase.php, line 89

Class

TranslatorPluginBase
Default controller class for service plugins.

Namespace

Drupal\tmgmt

Code

public function getSupportedLanguagePairs(TranslatorInterface $translator) {
  $language_pairs = array();
  foreach ($this
    ->getSupportedRemoteLanguages($translator) as $source_language) {
    foreach ($this
      ->getSupportedTargetLanguages($translator, $source_language) as $target_language) {
      $language_pairs[] = array(
        'source_language' => $source_language,
        'target_language' => $target_language,
      );
    }
  }
  return $language_pairs;
}