You are here

function tmgmt_local_supported_target_languages in Translation Management Tool 8

Same name and namespace in other branches
  1. 7 translators/tmgmt_local/tmgmt_local.module \tmgmt_local_supported_target_languages()

Gets supported target languages.

Parameters

string $source_language: Source language for which to get target languages.

array $uids: List of user ids for whom to get the target languages.

Return value

array List of target languages where code is the key as well as the value.

3 calls to tmgmt_local_supported_target_languages()
LocalTranslator::getSupportedTargetLanguages in translators/tmgmt_local/src/Plugin/tmgmt/Translator/LocalTranslator.php
Returns all available target languages that are supported by this service when given a source language.
LocalTranslatorTest::testAbilitiesAPI in translators/tmgmt_local/tests/src/Functional/LocalTranslatorTest.php
tmgmt_local_translation_access in translators/tmgmt_local/tmgmt_local.module
Determine whether the current user is allowed to translate a given translation task.

File

translators/tmgmt_local/tmgmt_local.module, line 540
Main module file for the local translation module.

Code

function tmgmt_local_supported_target_languages($source_language, $uids = array()) {
  $pairs = tmgmt_local_supported_language_pairs($source_language, $uids);
  $supported_languages = array();
  foreach ($pairs as $pair) {
    $supported_languages[$pair['target_language']] = $pair['target_language'];
  }
  return $supported_languages;
}