Gets existing translation language codes of the job item source.
Returns language codes that can be used as the source language for a translation job.
\Drupal\tmgmt\JobItemInterface $job_item: The job item.
array Array of language codes.
Overrides SourcePluginBase::getExistingLangCodes
public function getExistingLangCodes(JobItemInterface $job_item) {
$query = \Drupal::database()
->select('locales_target', 'lt');
$query
->fields('lt', array(
'language',
));
$query
->condition('lt.lid', $job_item
->getItemId());
$existing_lang_codes = array(
'en',
);
foreach ($query
->execute() as $language) {
$existing_lang_codes[] = $language->language;
}
return $existing_lang_codes;
}