You are here

public function TranslationsDataCollector::collect in Devel 4.x

Same name and namespace in other branches
  1. 8.3 webprofiler/src/DataCollector/TranslationsDataCollector.php \Drupal\webprofiler\DataCollector\TranslationsDataCollector::collect()
  2. 8 webprofiler/src/DataCollector/TranslationsDataCollector.php \Drupal\webprofiler\DataCollector\TranslationsDataCollector::collect()
  3. 8.2 webprofiler/src/DataCollector/TranslationsDataCollector.php \Drupal\webprofiler\DataCollector\TranslationsDataCollector::collect()

File

webprofiler/src/DataCollector/TranslationsDataCollector.php, line 46

Class

TranslationsDataCollector
Class TranslationsDataCollector.

Namespace

Drupal\webprofiler\DataCollector

Code

public function collect(Request $request, Response $response, \Exception $exception = NULL) {
  if ($this->translation instanceof TranslationManagerWrapper) {

    /** \Drupal\webprofiler\StringTranslation\TranslationManagerWrapper $this->translation */
    $this->data['translations']['translated'] = $this->translation
      ->getTranslated();
    $this->data['translations']['untranslated'] = $this->translation
      ->getUntranslated();
  }
  $this->data['user_interface_translations_path'] = $this->urlGenerator
    ->generateFromRoute('locale.translate_page');
}