You are here

public function LocalTranslator::getSupportedTargetLanguages in Translation Management Tool 8

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

translators/tmgmt_local/src/Plugin/tmgmt/Translator/LocalTranslator.php, line 73

Class

LocalTranslator
Drupal user provider.

Namespace

Drupal\tmgmt_local\Plugin\tmgmt\Translator

Code

public function getSupportedTargetLanguages(TranslatorInterface $translator, $source_language) {
  $languages = tmgmt_local_supported_target_languages($source_language);
  if (\Drupal::config('tmgmt_local.settings')
    ->get('allow_all')) {
    $languages += parent::getSupportedTargetLanguages($translator, $source_language);
  }
  return $languages;
}