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

avpaderno’s picture

Title: Token support for satus messages » Token support for status messages
mercmobily’s picture

Hi,

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.

walker2238’s picture

Okay 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.

avpaderno’s picture

Maybe the support for token.module is a little too much in this case, but being able to customize the error message more makes sense.

walker2238’s picture

Title: Token support for status messages » Improve customization for status messages

Yeah I agree. My wording in my first post was poorly thought out.

avpaderno’s picture

+1 for the feature.

mercmobily’s picture

Hi,

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.

avpaderno’s picture

You cannot call t() on the result of a previous call of t(). 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.

mercmobily’s picture

Status: Active » Closed (won't fix)

Hi,

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.

avpaderno’s picture

The 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.

mercmobily’s picture

Hi,

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.