Since the username display can be themed buddylist should use that instead of $account->name in messages, confirmations, etc. This is done in some places but not others.

Comments

dldege’s picture

Status: Active » Needs review
StatusFileSize
new5.62 KB

Please review - this RTBC otherwise.

john morahan’s picture

Status: Needs review » Needs work

In buddylist_deletebuddy_submit():

+ drupal_set_message(t('!username has been removed from your @buddylist', array('!username' => theme('username', $removeuser)) + buddylist_translation()));

$removeuser does not exist in this context.

dldege’s picture

Status: Needs work » Needs review
StatusFileSize
new5.73 KB

oops, yeah, I moved that up from another location in the code - nice catch.

john morahan’s picture

Status: Needs review » Needs work

Looks good, it'll be great to be able to theme these. Two more things I noticed while testing:

1. In theme_add_to_buddylist_link():

+ return l(t('Add'), 'buddy/add/' . $buddyuser->uid, array('title' => 'Accept'), drupal_get_destination(), NULL, FALSE, TRUE);

'Accept' doesn't really make sense as a title here. This link appears on a user profile page, where you can either directly add the user as a buddy, or make a request to add them. Accepting a request happens elsewhere.

2. You missed one in buddylist_addbuddy_submit():

drupal_set_message(t('%name will be be notified the next time s/he logs in.', array('%name' => $form_values['name'])));

(also, notice the repeated word "be" in that sentence).

There are two more, in buddylist_cancel_add() and buddylist_cancel_remove(), but those functions seem to be dead code AFAICT.

dldege’s picture

StatusFileSize
new8.5 KB

3rd times a charm, hopefully.
I removed 'user' form the action links so its consistent with the others. I also fixed the titles and wrapped them in t()
removed the dead code - I looked a ways back in the history and they haven't been used for a long time.

The next thing we'll need to look at is the mail replacements - we should probably use theme('username'...) there as well but we can do that in a separate issue so we can get this one checked in and the other one regarding translations.

dldege’s picture

Status: Needs work » Needs review
john morahan’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new8.43 KB

This one looks good. I fixed that "will be be notified" and a second instance of the same thing - otherwise this patch is identical to your last one.

I'm not sure about the mails though - theme('username') normally generates HTML output, which you might not want in a mail.

dldege’s picture

Assigned: dldege » Unassigned
Status: Reviewed & tested by the community » Fixed

doh, forgot about the 'be be' - thanks.

fixed in version 1.68.2.34.

Anonymous’s picture

Status: Fixed » Closed (fixed)