You are here

public function TMGMTDefaultTranslatorPluginController::getNotCanTranslateReason in Translation Management Tool 7

Return a reason why the translator is not able to translate this job.

@todo Remove this once http://drupal.org/node/1420364 is done.

Parameters

TMGMTJob $job: The job entity.

Might be called when canTranslate() returns FALSE to get a reason that can be displayed to the user.

Overrides TMGMTTranslatorPluginControllerInterface::getNotCanTranslateReason

File

plugin/tmgmt.plugin.translator.inc, line 165
Contains the abstract translator base plugin class.

Class

TMGMTDefaultTranslatorPluginController
Default controller class for service plugins.

Code

public function getNotCanTranslateReason(TMGMTJob $job) {
  $wrapper = entity_metadata_wrapper('tmgmt_job', $job);
  return t('@translator can not translate from @source to @target.', array(
    '@translator' => $job
      ->getTranslator()
      ->label(),
    '@source' => $wrapper->source_language
      ->label(),
    '@target' => $wrapper->target_language
      ->label(),
  ));
}