Multi part messages
-------------------
Usually a heartbeat message consists of words and tokens. But sometimes it happens
that a heartbeat message has an extra thingy, the token that needs to be translated
as well. e.g. "Peter is now friend with Walter" is a valid message, composed by
"@username1 is now @relation_type with @username2". after going through the t function
and substitute the message in dutch, I ended up with : "Peter is nu friend with Walter".
Friend is the word that needed to be pre-translated before. From friend to vriend.
The solution is now to use # as prefix for multi part messages with substrings that need
to be translated before the rules tokenizer does the magic.
Take care, in the messages you still use @relation_type, but in the variables you must
define the message parts tokens with #.
Conclusion:
@username : normal input evaluator
#relation_type: will be translated first before ending up as normal input evaluator @relation_type
Concatenated messages
---------------------
message_concat in heartbeat_messages is the string used when messages need to be merged.
Together with concat_args we can rebuild a part of the message with the stuff to be
merged. e.g. Paul is now friend with Walter, Mike and Evelyne or Paul updated 'Why on earth?' on 12-12-2008.
There are a couple of heartbeat user_activity settings that affect the merging. Timespan when merge should
occur, maximum and minimum values, user karma point system logged, etc ...
Usage
-----
When working with rules and the default rules described in modules, it is possible
to change the actions, add condtions, do whatever you like ...
Assuming your site is multilingual, you need to be aware of the fact that words and
sentences are only translatable once they are viewed in the browser, parsed by the
t function (drupal translation function, locale).
- enable heartbeat, user_activity and its contribute activity submodules
- [optional change a rules action by updating the message with your own words (and tokens)]
- go to admin/build/translate/search to translate the message AND message parts that are prefixed with '#'
- trigger the event by doing what the rules event describes
- go to heartbeat/user/[uid] or heartbeat/my_activity to view the result.
If the translations were not enforced, this could be for a couple of reasons:
Could be the wrong string is translated (or was not avaible yet to translate)
Could be the string is translatable when this rule was invoked. (too me , it was
sometimes correct , sometimes after the first time the event was invoked, bizarre)
Requirements on Rules and tokens
--------------------------------
- patch the token module with http://drupal.org/node/331046
or look if it is covered in latest release (this message should be gone by then)
- DO NOT enable token_actions module!
Stalski
View source
- Multi part messages
- -------------------
-
- Usually a heartbeat message consists of words and tokens. But sometimes it happens
- that a heartbeat message has an extra thingy, the token that needs to be translated
- as well. e.g. "Peter is now friend with Walter" is a valid message, composed by
- "@username1 is now @relation_type with @username2". after going through the t function
- and substitute the message in dutch, I ended up with : "Peter is nu friend with Walter".
- Friend is the word that needed to be pre-translated before. From friend to vriend.
-
- The solution is now to use # as prefix for multi part messages with substrings that need
- to be translated before the rules tokenizer does the magic.
- Take care, in the messages you still use @relation_type, but in the variables you must
- define the message parts tokens with #.
- Conclusion:
- @username : normal input evaluator
- #relation_type: will be translated first before ending up as normal input evaluator @relation_type
-
-
-
- Concatenated messages
- ---------------------
-
- message_concat in heartbeat_messages is the string used when messages need to be merged.
- Together with concat_args we can rebuild a part of the message with the stuff to be
- merged. e.g. Paul is now friend with Walter, Mike and Evelyne or Paul updated 'Why on earth?' on 12-12-2008.
- There are a couple of heartbeat user_activity settings that affect the merging. Timespan when merge should
- occur, maximum and minimum values, user karma point system logged, etc ...
-
-
-
- Usage
- -----
-
- When working with rules and the default rules described in modules, it is possible
- to change the actions, add condtions, do whatever you like ...
- Assuming your site is multilingual, you need to be aware of the fact that words and
- sentences are only translatable once they are viewed in the browser, parsed by the
- t function (drupal translation function, locale).
- - enable heartbeat, user_activity and its contribute activity submodules
- - [optional change a rules action by updating the message with your own words (and tokens)]
- - go to admin/build/translate/search to translate the message AND message parts that are prefixed with '#'
- - trigger the event by doing what the rules event describes
- - go to heartbeat/user/[uid] or heartbeat/my_activity to view the result.
-
- If the translations were not enforced, this could be for a couple of reasons:
- Could be the wrong string is translated (or was not avaible yet to translate)
- Could be the string is translatable when this rule was invoked. (too me , it was
- sometimes correct , sometimes after the first time the event was invoked, bizarre)
-
-
-
- Requirements on Rules and tokens
- --------------------------------
-
- - patch the token module with http://drupal.org/node/331046
- or look if it is covered in latest release (this message should be gone by then)
- - DO NOT enable token_actions module!
-
-
- Stalski