Gets list of language pairs.
string $source_language: Source language code for which to limit the selection.
array $uids: List of user ids for whom to get the language pairs.
array List of language pairs where a pair is defined by associative array of source_language and target_language keys.
function tmgmt_local_supported_language_pairs($source_language = NULL, $uids = array()) {
$language_pairs =& drupal_static(__FUNCTION__);
$cache_key = $source_language . '_' . implode('_', $uids);
if (isset($language_pairs[$cache_key])) {
return $language_pairs[$cache_key];
}
$language_pairs[$cache_key] = array();
foreach (tmgmt_local_abilities($source_language, NULL, $uids) as $row) {
// Prevent duplicates.
$pair_key = $row->tmgmt_translation_skills_language_from . '__' . $row->tmgmt_translation_skills_language_to;
$language_pairs[$cache_key][$pair_key] = array(
'source_language' => $row->tmgmt_translation_skills_language_from,
'target_language' => $row->tmgmt_translation_skills_language_to,
);
}
return $language_pairs[$cache_key];
}