public function TranslatorPluginBase::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 TranslatorPluginInterface::getSupportedTargetLanguages

1 method overrides TranslatorPluginBase::getSupportedTargetLanguages()
TestTranslator::getSupportedTargetLanguages in tmgmt_test/src/Plugin/tmgmt/Translator/TestTranslator.php
Returns all available target languages that are supported by this service when given a source language.

File

src/TranslatorPluginBase.php, line 77

Class

TranslatorPluginBase
Default controller class for service plugins.

Namespace

Drupal\tmgmt

Code

public function getSupportedTargetLanguages(TranslatorInterface $translator, $source_language) {
  $languages = tmgmt_available_languages();
  return array_combine(array_keys($languages), array_keys($languages));
}