function 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');
}