You are here

public function LocaleSource::getLabel in Translation Management Tool 8

Return a title for this job item.

Parameters

\Drupal\tmgmt\JobItemInterface $job_item: 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);
  }
}