Saves a translation.
\Drupal\tmgmt\JobItemInterface $job_item: The job item entity.
string $target_langcode: The target language code.
bool TRUE if the translation was saved successfully, FALSE otherwise.
Overrides SourcePluginInterface::saveTranslation
public function saveTranslation(JobItemInterface $job_item, $target_langcode) {
$data = $job_item
->getData();
if (isset($data['singular'])) {
$translation = $data['singular']['#translation']['#text'];
// Update the locale string in the system.
// @todo: Send error message to user if update fails.
if ($this
->updateTranslation($job_item
->getItemId(), $target_langcode, $translation)) {
return TRUE;
}
}
return FALSE;
}