在Drupal 7中更改消息 [英] Alter messages in Drupal 7
问题描述
谢谢!
虽然没有设置消息,可以通过 hook_preprocess_status_messages
在显示中更改它们,参见 http://api.drupal.org/api/drupal/includes--theme.inc/function / theme / 7 进行预处理和 http ://api.drupal.org/api/drupal/includes--theme.inc/function/theme_status_messages/7 。
编辑:你也可以尝试字符串覆盖检查 http://api.drupal。 org / api / drupal / includes - bootstrap.inc / function / t / 7 ,简称 $ conf ['locale_custom_strings_en'] ['some message'] ='some messbge';
fo r英语,如果不是英文,请更改 _en
以获取其他内容。
There is a couple of messages in drupal. When there is a php warning, an error message is raised, but a module can also raise messages with drupal_set_message(). The question is: Is there a way to alter these messages? For example to replace every 'a' with 'b' in every message.
Thanks!
While there is no message alter on set, you can change them on display via hook_preprocess_status_messages
, see http://api.drupal.org/api/drupal/includes--theme.inc/function/theme/7 on preprocess and http://api.drupal.org/api/drupal/includes--theme.inc/function/theme_status_messages/7 .
Edit: also you can try string overrides check http://api.drupal.org/api/drupal/includes--bootstrap.inc/function/t/7 , in short $conf['locale_custom_strings_en']['some message'] = 'some messbge';
for English, change _en
for something else if it's not English.
这篇关于在Drupal 7中更改消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!