Alter messages in Drupal 7(在 Drupal 7 中更改消息)
问题描述
drupal 中有几条消息.当出现 php 警告时,会引发错误消息,但模块也可以使用 drupal_set_message() 引发消息.问题是:有没有办法改变这些消息?例如,将每条消息中的每个a"替换为b".
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.
谢谢!
推荐答案
虽然现场没有消息更改,但您可以通过 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 .
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 .
您也可以尝试字符串覆盖检查 http://api.drupal.org/api/drupal/includes--bootstrap.inc/function/t/7 ,简而言之 $conf['locale_custom_strings_en']['some message'] ='some messbge';
为英文,如果不是英文,请将 _en
更改为其他内容.
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 中更改消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 Drupal 7 中更改消息


- 如何从数据库中获取数据以在 laravel 中查看页面? 2022-01-01
- Laravel 5:Model.php 中的 MassAssignmentException 2021-01-01
- 覆盖 Magento 社区模块控制器的问题 2022-01-01
- PHP foreach() 与数组中的数组? 2022-01-01
- 如何在 Symfony2 中正确使用 webSockets 2021-01-01
- openssl_digest vs hash vs hash_hmac?盐与盐的区别HMAC? 2022-01-01
- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
- 使用 GD 和 libjpeg 支持编译 PHP 2022-01-01
- PHP - if 语句中的倒序 2021-01-01
- 如何使用 Google API 在团队云端硬盘中创建文件夹? 2022-01-01