Custom message

Release Package Date
6.x-1.x-dev-pasq Download (9.16 KB) Release notes Aug 9 2011

Create translatable messages which can be displayed with Rules. Rule tokens (and php replacement) should work.
Use Translation table module to set and translate the messages. Custom message module creates the message key and message description only, the messages are created with translation table (or with core translation functionality, or with l10n_client). The translation table is the most convenient way to create the messages.

You might need to set

$conf['i18nstrings_translate_langcode_en'] = TRUE;

to display custom messages in default language. (replace 'en' with your default language, if it is something else. see details: conf documentation, translation table explanation)

Step by step example:

1. requirements: Drupal 6; +modules: Rules, Token, Internationalization, Translation table, Custom message
2. install Drupal 6
3. enable modules: Rules Administraion UI, Token, Custom message, Translation table (+ all dependencies)
4. add language admin/settings/language/add [ languge: German ]
5. set language negotiation admin/settings/language/configure [ negotiation: Path prefix only (save settigns) ]
6. add custom message admin/build/custom-message/add [ message key: thank_you; description: Thank you message (save) ]
7. add rule admin/rules/trigger/add [ Label: Show message after node is created; Event: After saving new content (save changes) ]
8. add action to rule admin/rules/rules/rules_show_message_after_node_is_created [ Action: Custom message: Dislay a translatable custom message (next) message type: normal (save) ]
9. refresh the strings admin/build/translate/refresh [ Select text groups: Custom messages (Refresh strings) ]
10. edit message admin/build/translate/table/custom_message [ English: Thank you [node:author-name]; German: Danke [node:author-name] (save) ]
11. add $conf['i18nstrings_translate_langcode_en'] = TRUE; to setting php

node/add/page: custom message is displayed in English after saving the node.
de/node/add/page: custom message is displayed in German after saving the node.

Sponsored by