public function TestTranslator::getSupportedTargetLanguages

Returns all available target languages that are supported by this service when given a source language.

Parameters

TranslatorInterface $translator: The translator entity.

$source_language: The source language.

Return value

array An array of remote languages in ISO format.

Overrides TranslatorPluginBase::getSupportedTargetLanguages

File

tmgmt_test/src/Plugin/tmgmt/Translator/TestTranslator.php, line 119

Class

TestTranslator
Test source plugin implementation.

Namespace

Drupal\tmgmt_test\Plugin\tmgmt\Translator

Code

public function getSupportedTargetLanguages(TranslatorInterface $translator, $source_language) {
  $languages = array(
    'en',
    'de',
    'es',
    'it',
    'pt',
    'zh-hans',
    'gsw-berne',
  );
  $languages = array_combine($languages, $languages);
  unset($languages[$source_language]);
  return $languages;
}