diff --git a/src/Plugin/tmgmt/Translator/MyGengoTranslator.php b/src/Plugin/tmgmt/Translator/MyGengoTranslator.php index 11c81fe..109dadb 100644 --- a/src/Plugin/tmgmt/Translator/MyGengoTranslator.php +++ b/src/Plugin/tmgmt/Translator/MyGengoTranslator.php @@ -588,11 +588,23 @@ class MyGengoTranslator extends TranslatorPluginBase implements ContainerFactory } } + // Add a message to the job item. + $count_remotes = count($remotes); if ($count_aborted > 1) { - $job_item->addMessage('@count_aborted jobs out of @count_total have been aborted at Gengo.', array('@count_aborted' => $count_aborted, '@count_total' => count($remotes))); + if ($count_aborted != $count_remotes) { + $job_item->addMessage('@count_aborted jobs out of @count_total have been aborted at Gengo. Gengo does not allow aborting jobs that are already in translation.', ['@count_aborted' => $count_aborted, '@count_total' => count($remotes)], 'warning'); + } + else { + $job_item->addMessage('@count_aborted jobs out of @count_total have been aborted at Gengo.', ['@count_aborted' => $count_aborted, '@count_total' => count($remotes)]); + } } else { - $job_item->addMessage('@count_aborted job out of @count_total has been aborted at Gengo.', array('@count_aborted' => $count_aborted, '@count_total' => count($remotes))); + if ($count_aborted != $count_remotes) { + $job_item->addMessage('@count_aborted job out of @count_total has been aborted at Gengo. Gengo does not allow aborting jobs that are already in translation.', ['@count_aborted' => $count_aborted, '@count_total' => count($remotes)], 'warning'); + } + else { + $job_item->addMessage('@count_aborted job out of @count_total has been aborted at Gengo.', ['@count_aborted' => $count_aborted, '@count_total' => count($remotes)]); + } } // Abort the job item even if Gengo job(s) couldn't be aborted.