From d9f36ae7e1e6bf6aeb69f2491234ce0903a6543d Mon Sep 17 00:00:00 2001
From: Joas Schilling <nickvergessen@gmx.de>
Date: Tue, 9 Sep 2014 21:28:01 +0200
Subject: [PATCH] [ticket/12976] Correctly use plurals for attachment count in
 UCP navigation

PHPBB3-12976
---
 phpBB/includes/ucp/ucp_attachments.php                | 1 +
 phpBB/language/en/common.php                          | 4 ++++
 phpBB/styles/prosilver/template/ucp_attachments.html  | 2 +-
 phpBB/styles/subsilver2/template/ucp_attachments.html | 2 +-
 4 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/phpBB/includes/ucp/ucp_attachments.php b/phpBB/includes/ucp/ucp_attachments.php
index aab45339c5..42724209aa 100644
--- a/phpBB/includes/ucp/ucp_attachments.php
+++ b/phpBB/includes/ucp/ucp_attachments.php
@@ -182,6 +182,7 @@ class ucp_attachments
 
 		$template->assign_vars(array(
 			'TOTAL_ATTACHMENTS'		=> $num_attachments,
+			'NUM_ATTACHMENTS'		=> $user->lang('NUM_ATTACHMENTS', $num_attachments),
 
 			'L_TITLE'				=> $user->lang['UCP_ATTACHMENTS'],
 
diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php
index c27086fd38..83e1f4eaa1 100644
--- a/phpBB/language/en/common.php
+++ b/phpBB/language/en/common.php
@@ -518,6 +518,10 @@ $lang = array_merge($lang, array(
 	'NO_USER_SPECIFIED'			=> 'No username was specified.',
 
 	// Nullar/Singular/Plural language entry. The key numbers define the number range in which a certain grammatical expression is valid.
+	'NUM_ATTACHMENTS'		=> array(
+		1	=> '%d attachment',
+		2	=> '%d attachments',
+	),
 	'NUM_POSTS_IN_QUEUE'		=> array(
 		0			=> 'No posts in queue',		// 0
 		1			=> '1 post in queue',		// 1
diff --git a/phpBB/styles/prosilver/template/ucp_attachments.html b/phpBB/styles/prosilver/template/ucp_attachments.html
index ddbf892dee..1d4963273c 100644
--- a/phpBB/styles/prosilver/template/ucp_attachments.html
+++ b/phpBB/styles/prosilver/template/ucp_attachments.html
@@ -12,7 +12,7 @@
 	<!-- IF .attachrow -->
 		<div class="action-bar top">
 			<div class="pagination">
-				{TOTAL_ATTACHMENTS} {L_TITLE}
+				{NUM_ATTACHMENTS}
 				<!-- IF .pagination --> 
 					<!-- INCLUDE pagination.html -->
 				<!-- ELSE --> 
diff --git a/phpBB/styles/subsilver2/template/ucp_attachments.html b/phpBB/styles/subsilver2/template/ucp_attachments.html
index 0f6101aac7..c513f933c0 100644
--- a/phpBB/styles/subsilver2/template/ucp_attachments.html
+++ b/phpBB/styles/subsilver2/template/ucp_attachments.html
@@ -17,7 +17,7 @@
 				<table width="100%" cellspacing="1">
 				<tr>
 					<td class="nav" valign="middle" nowrap="nowrap">&nbsp;{PAGE_NUMBER}<br /></td>
-					<td class="gensmall" nowrap="nowrap">&nbsp;[ {TOTAL_ATTACHMENTS} ]&nbsp;</td>
+					<td class="gensmall" nowrap="nowrap">&nbsp;[ {NUM_ATTACHMENTS} ]&nbsp;</td>
 					<td class="gensmall" width="100%" align="{S_CONTENT_FLOW_END}" nowrap="nowrap"><!-- INCLUDE pagination.html --></td>
 				</tr>
 				</table>