From 126ee37f6692a7c52fd8f6527af2dc06cda50a8b Mon Sep 17 00:00:00 2001 From: Cesar G Date: Sun, 1 Dec 2013 11:25:54 -0800 Subject: [ticket/11959] Use the plurals system for the untrimmed language strings. PHPBB3-11959 --- phpBB/phpbb/notification/type/post.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/notification/type/post.php b/phpBB/phpbb/notification/type/post.php index bc42c4422b..a883e67bd4 100644 --- a/phpBB/phpbb/notification/type/post.php +++ b/phpBB/phpbb/notification/type/post.php @@ -210,13 +210,18 @@ class post extends \phpbb\notification\type\base if ($trimmed_responders_cnt) { $lang_key .= '_TRIMMED'; + $lang_user_cnt = $trimmed_responders_cnt; + } + else + { + $lang_user_cnt = $responders_cnt; } return $this->user->lang( $lang_key, implode($this->user->lang['COMMA_SEPARATOR'], $usernames), censor_text($this->get_data('topic_title')), - $trimmed_responders_cnt + $lang_user_cnt ); } -- cgit v1.2.1 From b32a66ca78b6170c0d90b7776dabdf8f343c557a Mon Sep 17 00:00:00 2001 From: Cesar G Date: Sun, 1 Dec 2013 12:20:43 -0800 Subject: [ticket/11959] List the last user with "and" instead of a comma. PHPBB3-11959 --- phpBB/phpbb/notification/type/post.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'phpBB/phpbb') 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 ); -- cgit v1.2.1 From 285ad0f6faac275c56576616ed6a880a7f88e94b Mon Sep 17 00:00:00 2001 From: Cesar G Date: Fri, 7 Feb 2014 14:56:14 -0800 Subject: [ticket/11959] Simplify how the users are trimmed. PHPBB3-11959 --- phpBB/phpbb/notification/type/post.php | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/notification/type/post.php b/phpBB/phpbb/notification/type/post.php index 944023cba4..62c8bd52cb 100644 --- a/phpBB/phpbb/notification/type/post.php +++ b/phpBB/phpbb/notification/type/post.php @@ -205,30 +205,22 @@ 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) { - $lang_key .= '_TRIMMED'; - $lang_user_cnt = $trimmed_responders_cnt; + $usernames[] = $this->user->lang('NOTIFICATION_X_OTHERS', $trimmed_responders_cnt); } - else - { - $lang_user_cnt = $responders_cnt; - if ($responders_cnt > 1) - { - $last_user = array_pop($usernames); - } + if (!function_exists('phpbb_gen_string_list')) + { + include($this->phpbb_root_path . 'includes/functions_display.' . $this->php_ex); } return $this->user->lang( - $lang_key, - implode($this->user->lang['COMMA_SEPARATOR'], $usernames), - $last_user, + $this->language_key, + phpbb_gen_string_list($usernames, $this->user), censor_text($this->get_data('topic_title')), - $lang_user_cnt + $responders_cnt ); } -- cgit v1.2.1 From 3da1f6d989357c9076ffde532cfbbd3d6375aa3c Mon Sep 17 00:00:00 2001 From: Cesar G Date: Fri, 14 Mar 2014 19:19:39 -0700 Subject: [ticket/11959] Rename phpbb_gen_string_list() & fix incorrect var name. PHPBB3-11959 --- phpBB/phpbb/notification/type/post.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/notification/type/post.php b/phpBB/phpbb/notification/type/post.php index 62c8bd52cb..d3491a3f5e 100644 --- a/phpBB/phpbb/notification/type/post.php +++ b/phpBB/phpbb/notification/type/post.php @@ -211,14 +211,14 @@ class post extends \phpbb\notification\type\base $usernames[] = $this->user->lang('NOTIFICATION_X_OTHERS', $trimmed_responders_cnt); } - if (!function_exists('phpbb_gen_string_list')) + if (!function_exists('phpbb_generate_string_list')) { - include($this->phpbb_root_path . 'includes/functions_display.' . $this->php_ex); + include($this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext); } return $this->user->lang( $this->language_key, - phpbb_gen_string_list($usernames, $this->user), + phpbb_generate_string_list($usernames, $this->user), censor_text($this->get_data('topic_title')), $responders_cnt ); -- cgit v1.2.1 From b893dae105f72b7c34abe855e24f0dec35206208 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Sat, 29 Mar 2014 09:29:47 -0700 Subject: [ticket/11959] Move phpbb_generate_string_list() to functions_content.php. PHPBB3-11959 --- phpBB/phpbb/notification/type/post.php | 5 ----- 1 file changed, 5 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/notification/type/post.php b/phpBB/phpbb/notification/type/post.php index d3491a3f5e..140c0ad82a 100644 --- a/phpBB/phpbb/notification/type/post.php +++ b/phpBB/phpbb/notification/type/post.php @@ -211,11 +211,6 @@ class post extends \phpbb\notification\type\base $usernames[] = $this->user->lang('NOTIFICATION_X_OTHERS', $trimmed_responders_cnt); } - if (!function_exists('phpbb_generate_string_list')) - { - include($this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext); - } - return $this->user->lang( $this->language_key, phpbb_generate_string_list($usernames, $this->user), -- cgit v1.2.1