function tmgmt_translator_load_available in Translation Management Tool 7
Same name and namespace in other branches
- 8 tmgmt.module \tmgmt_translator_load_available()
Loads all translators that are available and, if a translation job is given, support translations for that job with its current configuration.
Parameters
TMGMTJob $job: (Optional) A translation job.
Return value
array An array of translators with the machine-readable name of the translators as array keys.
Related topics
1 call to tmgmt_translator_load_available()
- tmgmt_ui_job_needs_checkout_form in ui/
tmgmt_ui.module - Check if a job needs a checkout form. The current checks include if there is more than one translator available, if he has settings and if the job has a fixed target language.
File
- ./
tmgmt.module, line 905 - Main module file for the Translation Management module.
Code
function tmgmt_translator_load_available($job) {
$translators = tmgmt_translator_load_multiple(FALSE);
foreach ($translators as $name => $translator) {
if (!$translator
->isAvailable() || isset($job) && !$translator
->canTranslate($job)) {
unset($translators[$name]);
}
}
return $translators;
}