Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function checkTranslatable(TranslatorInterface $translator, JobInterface $job)
 {
     // The job is only translatable if the translator is available too.
     if ($this->checkAvailable($translator)->getSuccess() && array_key_exists($job->getTargetLangcode(), $translator->getSupportedTargetLanguages($job->getSourceLangcode()))) {
         // We can only translate this job if the target language of the job is in
         // one of the supported languages.
         return TranslatableResult::yes();
     }
     return TranslatableResult::no(t('@translator can not translate from @source to @target.', array('@translator' => $translator->label(), '@source' => $job->getSourceLanguage()->getName(), '@target' => $job->getTargetLanguage()->getName())));
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function checkTranslatable(TranslatorInterface $translator, JobInterface $job)
 {
     // Anything can be exported.
     return TranslatableResult::yes();
 }