public function LocaleSource::getLabel

Return a title for this job item.

Parameters

string|false: The label of the job item entity.

Overrides SourcePluginBase::getLabel

File

sources/locale/src/Plugin/tmgmt/Source/LocaleSource.php, line 153

Class

LocaleSource
Translation Source plugin for locale strings.

Namespace

Drupal\tmgmt_locale\Plugin\tmgmt\Source

Code

public function getLabel(JobItemInterface $job_item) {
  if ($locale_object = $this
    ->getLocaleObject($job_item)) {
    if ($locale_object->origin == 'source') {
      $label = $locale_object->source;
    }
    else {
      $label = $locale_object->translation;
    }
    return Unicode::truncate(strip_tags($label), 30, FALSE, TRUE);
  }
}