addStatus('Langcode Preprocess Test: ' . $langcode); $text .= 'Additional text'; } } // Prints the langcode for testPreprocessLangcode(). elseif (isset($langcode)) { \Drupal::messenger()->addStatus('Langcode Preprocess Test: ' . $langcode); // Preprocessing for the excerpt test. if ($langcode == 'ex') { $text = str_replace('finding', 'find', $text); $text = str_replace('finds', 'find', $text); $text = str_replace('dic', ' dependency injection container', $text); $text = str_replace('hypertext markup language', 'html', $text); } } return $text; }