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