diff options
author | Cesar G <prototech91@gmail.com> | 2013-12-01 12:20:43 -0800 |
---|---|---|
committer | Cesar G <prototech91@gmail.com> | 2014-03-19 03:08:33 -0700 |
commit | b32a66ca78b6170c0d90b7776dabdf8f343c557a (patch) | |
tree | e0930d20e3f90b13fbf8dedab6c4f54b36f9f36b | |
parent | 126ee37f6692a7c52fd8f6527af2dc06cda50a8b (diff) | |
download | forums-b32a66ca78b6170c0d90b7776dabdf8f343c557a.tar forums-b32a66ca78b6170c0d90b7776dabdf8f343c557a.tar.gz forums-b32a66ca78b6170c0d90b7776dabdf8f343c557a.tar.bz2 forums-b32a66ca78b6170c0d90b7776dabdf8f343c557a.tar.xz forums-b32a66ca78b6170c0d90b7776dabdf8f343c557a.zip |
[ticket/11959] List the last user with "and" instead of a comma.
PHPBB3-11959
-rw-r--r-- | phpBB/language/en/common.php | 21 | ||||
-rw-r--r-- | phpBB/phpbb/notification/type/post.php | 7 |
2 files changed, 22 insertions, 6 deletions
diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 437f3a190f..42965c460f 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -424,29 +424,38 @@ $lang = array_merge($lang, array( 'NOT_WATCHING_FORUM' => 'You are no longer subscribed to updates on this forum.', 'NOT_WATCHING_TOPIC' => 'You are no longer subscribed to this topic.', 'NOTIFICATIONS' => 'Notifications', + // This is used for a list of up to 4 users. 5 users or more uses _TRIMMED. 'NOTIFICATION_BOOKMARK' => array( - 1 => '%1$s replied to the topic “%2$s” you have bookmarked.', + 1 => '%1$s replied to the topic “%3$s” you have bookmarked.', + 2 => '%1$s and %2$s replied to the topic “%3$s” you have bookmarked.', ), + // X, Y, Z and 2 others replied to the topic “Test” you have bookmarked. 'NOTIFICATION_BOOKMARK_TRIMMED' => array( - 2 => '%1$s and %3$d others replied to the topic “%2$s” you have bookmarked.', + 2 => '%1$s and %4$d others replied to the topic “%3$s” you have bookmarked.', ), 'NOTIFICATION_GROUP_REQUEST' => '%1$s is requesting to join the group %2$s.', 'NOTIFICATION_GROUP_REQUEST_APPROVED' => 'Your request to join the group %1$s has been approved.', 'NOTIFICATION_PM' => '%1$s sent you a Private Message "%2$s".', + // This is used for a list of up to 4 users. 5 users or more uses _TRIMMED. 'NOTIFICATION_POST' => array( - 1 => '%1$s replied to the topic “%2$s”.', + 1 => '%1$s replied to the topic “%3$s”.', + 2 => '%1$s and %2$s replied to the topic “%3$s”.', ), + // X, Y, Z and 2 others replied to the topic “Test”. 'NOTIFICATION_POST_TRIMMED' => array( - 2 => '%1$s and %3$d others replied to the topic “%2$s”', + 2 => '%1$s and %4$d others replied to the topic “%3$s”', ), 'NOTIFICATION_POST_APPROVED' => 'Your post was approved "%2$s".', 'NOTIFICATION_POST_DISAPPROVED' => 'Your post "%1$s" was disapproved for reason: "%2$s".', 'NOTIFICATION_POST_IN_QUEUE' => 'A new post titled "%2$s" was posted by %1$s and needs approval.', + // This is used for a list of up to 4 users. 5 users or more uses _TRIMMED. 'NOTIFICATION_QUOTE' => array( - 1 => '%1$s quoted you in the post “%2$s”.', + 1 => '%1$s quoted you in the post “%3$s”.', + 2 => '%1$s and %2$s quoted you in the post “%3$s”.', ), + // X, Y, Z and 2 others quoted you in the post “Re: Test”. 'NOTIFICATION_QUOTE_TRIMMED' => array( - 2 => '%1$s and %3$d quoted you in the post “%2$s”', + 2 => '%1$s and %4$d quoted you in the post “%3$s”', ), 'NOTIFICATION_REPORT_PM' => '%1$s reported a Private Message "%2$s" for reason: "%3$s".', 'NOTIFICATION_REPORT_POST' => '%1$s reported a post "%2$s" for reason: "%3$s".', diff --git a/phpBB/phpbb/notification/type/post.php b/phpBB/phpbb/notification/type/post.php index a883e67bd4..944023cba4 100644 --- a/phpBB/phpbb/notification/type/post.php +++ b/phpBB/phpbb/notification/type/post.php @@ -205,6 +205,7 @@ class post extends \phpbb\notification\type\base $usernames[] = $this->user_loader->get_username($responder['poster_id'], 'no_profile'); } } + $last_user = ''; $lang_key = $this->language_key; if ($trimmed_responders_cnt) @@ -215,11 +216,17 @@ class post extends \phpbb\notification\type\base else { $lang_user_cnt = $responders_cnt; + + if ($responders_cnt > 1) + { + $last_user = array_pop($usernames); + } } return $this->user->lang( $lang_key, implode($this->user->lang['COMMA_SEPARATOR'], $usernames), + $last_user, censor_text($this->get_data('topic_title')), $lang_user_cnt ); |