getCurrentLanguage()->getId(); } // If the langcode is set to 'en' then add variations of the word "testing" // which can also be found during English language searches. if ($langcode == 'en') { // Add the alternate verb forms for the word "testing". if ($text == 'we are testing') { $text .= ' test tested'; } } return $text; } /** * Alter search plugin definitions. * * @param array $definitions * The array of search plugin definitions, keyed by plugin ID. * * @see \Drupal\search\Annotation\SearchPlugin * @see \Drupal\search\SearchPluginManager */ function hook_search_plugin_alter(array &$definitions) { if (isset($definitions['node_search'])) { $definitions['node_search']['title'] = t('Nodes'); } } /** * @} End of "addtogroup hooks". */