How about token support for status messages? I know theres tokens available for rules and sending email requests and such, wouldn't it make sense to have those tokens incorperated into the status message configuration page?
How about token support for status messages? I know theres tokens available for rules and sending email requests and such, wouldn't it make sense to have those tokens incorperated into the status message configuration page?
Comments
Comment #1
avpadernoComment #2
mercmobily commentedHi,
Please be *much* clearer!
I haven't touched Rules and Token for 6 months, I need refreshing -- sorry. Only just taken over the module again recently.
Merc.
Comment #3
walker2238 commentedOkay bear with me. When the module is installed and a relationship has been made, theres is the Friendlist UI module configuration page to set status messages.
As an example if I used the a default fan relationship with the default status messages it would something like "You're not a !rt_name" Where !rt_name would be the name of the relationship.
I just thought it might be worth looking into to add a few more "tokens". One off the top of my head would be username. So that from my previous example above one could set the status message to You're not a !rt_name of !rt_username" Where !rt_username would be the name of the currently view profile.
Now that I think of it, this doesn't even have to reply on token support as there wouldn't be a need to use anything other then the name of the relationship and the name of the user who you wish to create a relationship with.
Hope that helps clear things up.
Comment #4
avpadernoMaybe the support for token.module is a little too much in this case, but being able to customize the error message more makes sense.
Comment #5
walker2238 commentedYeah I agree. My wording in my first post was poorly thought out.
Comment #6
avpaderno+1 for the feature.
Comment #7
mercmobily commentedHi,
Quick idea.
What if we surround the message by t() twice?
For example, right now we have:
"Become a !rt_name"
That's hard coded, which is crap. That could become for example "Become a dad" (I picked something weird on purpose, "Become a dad" sounds silly).
So, what if we surrounded any instance where the status is displayed by t() AGAIN? So, in your own translation strings, you can then translate "Become a dad" into "Become the user's father" or whatever. That way, you would use the string customisation... twice.
Just an idea. Would it work?
Merc.
Comment #8
avpadernoYou cannot call
t()on the result of a previous call oft(). Suppose there is the Italian translator for the module, and Italian is the language used for a page request; the first call translate from English to Italian, and the second call should try to find the Italian translation for an Italian sentence.t()is only called to use the translated string of strings used by the modules, and it requires an English string as input; it's not used to replace a placeholder with the actual value to use.Comment #9
mercmobily commentedHi,
Arghhh OK.
But then again, the module offers a GUI to change the messages as much as you like.
Token support is a _total_ overkill here... marking as won't fix, unless you guys point out that I am actually missing something (which is always VERY possible!).
Bye!
Mrc.
Comment #10
avpadernoThe suggestion was to support more placeholders than actually supported. One placeholder was already suggested, and more placeholders could possibly be added, even without to provide a plethora of placeholders.
Comment #11
mercmobily commentedHi,
Please open a new issue called "Support more placeholders for status messages" where you just list briefly the placeholders you suggest. This issue has become a little too messy now....
I will probably add this feature quite soon!
Merc.