search_api_page.inc 结果 - 文本更改

search_api_page.inc Results - Text change

我需要更改默认文本:" 'The search found 1 result in @sec seconds.', 'The search found @count results in @sec seconds.'," 在 search_api_page.inc 文件中。

为了不更改此模块,最好的方法是什么?

由于这是预处理函数,我们可以通过简单地复制 search_api_page.inc 中的整个函数(函数 template_preprocess_search_api_page_results)在我们的自定义模块中重新声明它 当然,将 "template" 重命名为您的模块名称,并根据您的需要更改文本。您可以更改结果以及 "no results text there".

希望对您有所帮助!