Skip to content

Instantly share code, notes, and snippets.

@nickvergessen
Created September 13, 2011 22:05
Show Gist options
  • Save nickvergessen/1215299 to your computer and use it in GitHub Desktop.
Save nickvergessen/1215299 to your computer and use it in GitHub Desktop.
Plurals patch for language/en/ files (NOT acp/
diff --git a/phpBB/feed.php b/phpBB/feed.php
index 9816f0f..9cb9f6f 100644
--- a/phpBB/feed.php
+++ b/phpBB/feed.php
@@ -1169,7 +1169,7 @@ class phpbb_feed_forums extends phpbb_feed_base
{
global $user;
- $item_row['statistics'] = sprintf($user->lang['TOTAL_TOPICS_OTHER'], $row['forum_topics'])
+ $item_row['statistics'] = $user->lang('TOTAL_TOPICS', (int) $row['forum_topics'])
. ' ' . $this->separator_stats . ' ' . sprintf($user->lang['TOTAL_POSTS_OTHER'], $row['forum_posts']);
}
}
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 628f8ee..c9a0b12 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -4161,59 +4161,26 @@ function obtain_users_online_string($online_users, $item_id = 0, $item = 'forum'
}
else if ($config['load_online_guests'])
{
- $l_online = ($online_users['guests_online'] === 1) ? $user->lang['BROWSING_' . $item_caps . '_GUEST'] : $user->lang['BROWSING_' . $item_caps . '_GUESTS'];
- $online_userlist = sprintf($l_online, $online_userlist, $online_users['guests_online']);
+ $online_userlist = $user->lang('BROWSING_' . $item_caps . '_GUESTS', $online_users['guests_online'], $online_userlist);
}
else
{
$online_userlist = sprintf($user->lang['BROWSING_' . $item_caps], $online_userlist);
}
// Build online listing
- $vars_online = array(
- 'ONLINE' => array('total_online', 'l_t_user_s', 0),
- 'REG' => array('visible_online', 'l_r_user_s', !$config['load_online_guests']),
- 'HIDDEN' => array('hidden_online', 'l_h_user_s', $config['load_online_guests']),
- 'GUEST' => array('guests_online', 'l_g_user_s', 0)
- );
+ $visible_online = $user->lang('REG_USERS_TOTAL', (int) $online_users['visible_online']);
+ $hidden_online = $user->lang('HIDDEN_USERS_TOTAL', (int) $online_users['hidden_online']);
- foreach ($vars_online as $l_prefix => $var_ary)
+ if ($config['load_online_guests'])
{
- if ($var_ary[2])
- {
- $l_suffix = '_AND';
- }
- else
- {
- $l_suffix = '';
- }
- switch ($online_users[$var_ary[0]])
- {
- case 0:
- ${$var_ary[1]} = $user->lang[$l_prefix . '_USERS_ZERO_TOTAL' . $l_suffix];
- break;
-
- case 1:
- ${$var_ary[1]} = $user->lang[$l_prefix . '_USER_TOTAL' . $l_suffix];
- break;
-
- default:
- ${$var_ary[1]} = $user->lang[$l_prefix . '_USERS_TOTAL' . $l_suffix];
- break;
- }
+ $guests_online = $user->lang('GUEST_USERS_TOTAL', (int) $online_users['guests_online']);
+ $l_online_users = $user->lang('ONLINE_USERS_TOTAL_GUESTS', (int) $online_users['total_online'], $visible_online, $hidden_online, $guests_online);
}
- unset($vars_online);
-
- $l_online_users = sprintf($l_t_user_s, $online_users['total_online']);
- $l_online_users .= sprintf($l_r_user_s, $online_users['visible_online']);
- $l_online_users .= sprintf($l_h_user_s, $online_users['hidden_online']);
-
- if ($config['load_online_guests'])
+ else
{
- $l_online_users .= sprintf($l_g_user_s, $online_users['guests_online']);
+ $l_online_users = $user->lang('ONLINE_USERS_TOTAL', (int) $online_users['total_online'], $visible_online, $hidden_online);
}
-
-
return array(
'online_userlist' => $online_userlist,
'l_online_users' => $l_online_users,
@@ -4434,10 +4401,9 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
set_config('record_online_date', time(), true);
}
- $l_online_record = sprintf($user->lang['RECORD_ONLINE_USERS'], $config['record_online_users'], $user->format_date($config['record_online_date'], false, true));
+ $l_online_record = $user->lang('RECORD_ONLINE_USERS', (int) $config['record_online_users'], $user->format_date($config['record_online_date'], false, true));
- $l_online_time = ($config['load_online_time'] == 1) ? 'VIEW_ONLINE_TIME' : 'VIEW_ONLINE_TIMES';
- $l_online_time = sprintf($user->lang[$l_online_time], $config['load_online_time']);
+ $l_online_time = $user->lang('VIEW_ONLINE_TIMES', (int) $config['load_online_time']);
}
$l_privmsgs_text = $l_privmsgs_text_unread = '';
@@ -4448,8 +4414,7 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
{
if ($user->data['user_new_privmsg'])
{
- $l_message_new = ($user->data['user_new_privmsg'] == 1) ? $user->lang['NEW_PM'] : $user->lang['NEW_PMS'];
- $l_privmsgs_text = sprintf($l_message_new, $user->data['user_new_privmsg']);
+ $l_privmsgs_text = $user->lang('NEW_PMS', (int) $user->data['user_new_privmsg']);
if (!$user->data['user_last_privmsg'] || $user->data['user_last_privmsg'] > $user->data['session_last_visit'])
{
@@ -4467,7 +4432,7 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
}
else
{
- $l_privmsgs_text = $user->lang['NO_NEW_PM'];
+ $l_privmsgs_text = $user->lang('NEW_PMS', 0);
$s_privmsg_new = false;
}
@@ -4475,8 +4440,7 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
if ($user->data['user_unread_privmsg'] && $user->data['user_unread_privmsg'] != $user->data['user_new_privmsg'])
{
- $l_message_unread = ($user->data['user_unread_privmsg'] == 1) ? $user->lang['UNREAD_PM'] : $user->lang['UNREAD_PMS'];
- $l_privmsgs_text_unread = sprintf($l_message_unread, $user->data['user_unread_privmsg']);
+ $l_privmsgs_text_unread = $user->lang('UNREAD_PMS', (int) $user->data['user_unread_privmsg']);
}
}
diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php
index b7650ec..f655793 100644
--- a/phpBB/includes/functions_content.php
+++ b/phpBB/includes/functions_content.php
@@ -938,12 +938,12 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
}
$download_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'id=' . $attachment['attach_id']);
+ $l_downloaded_viewed = 'VIEWED_COUNTS';
switch ($display_cat)
{
// Images
case ATTACHMENT_CATEGORY_IMAGE:
- $l_downloaded_viewed = 'VIEWED_COUNT';
$inline_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'id=' . $attachment['attach_id']);
$download_link .= '&mode=view';
@@ -957,7 +957,6 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
// Images, but display Thumbnail
case ATTACHMENT_CATEGORY_THUMB:
- $l_downloaded_viewed = 'VIEWED_COUNT';
$thumbnail_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'id=' . $attachment['attach_id'] . '&t=1');
$download_link .= '&mode=view';
@@ -971,7 +970,6 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
// Windows Media Streams
case ATTACHMENT_CATEGORY_WM:
- $l_downloaded_viewed = 'VIEWED_COUNT';
// Giving the filename directly because within the wm object all variables are in local context making it impossible
// to validate against a valid session (all params can differ)
@@ -990,7 +988,6 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
// Real Media Streams
case ATTACHMENT_CATEGORY_RM:
case ATTACHMENT_CATEGORY_QUICKTIME:
- $l_downloaded_viewed = 'VIEWED_COUNT';
$block_array += array(
'S_RM_FILE' => ($display_cat == ATTACHMENT_CATEGORY_RM) ? true : false,
@@ -1007,8 +1004,6 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
case ATTACHMENT_CATEGORY_FLASH:
list($width, $height) = @getimagesize($filename);
- $l_downloaded_viewed = 'VIEWED_COUNT';
-
$block_array += array(
'S_FLASH_FILE' => true,
'WIDTH' => $width,
@@ -1021,7 +1016,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
break;
default:
- $l_downloaded_viewed = 'DOWNLOAD_COUNT';
+ $l_downloaded_viewed = 'DOWNLOAD_COUNTS';
$block_array += array(
'S_FILE' => true,
@@ -1029,11 +1024,14 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
break;
}
- $l_download_count = (!isset($attachment['download_count']) || $attachment['download_count'] == 0) ? $user->lang[$l_downloaded_viewed . '_NONE'] : (($attachment['download_count'] == 1) ? sprintf($user->lang[$l_downloaded_viewed], $attachment['download_count']) : sprintf($user->lang[$l_downloaded_viewed . 'S'], $attachment['download_count']));
+ if (!isset($attachment['download_count']))
+ {
+ $attachment['download_count'] = 0;
+ }
$block_array += array(
'U_DOWNLOAD_LINK' => $download_link,
- 'L_DOWNLOAD_COUNT' => $l_download_count
+ 'L_DOWNLOAD_COUNT' => $user->lang($l_downloaded_viewed, (int) $attachment['download_count']),
);
}
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index 14d0c44..d3d204e 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -1060,10 +1060,10 @@ function display_user_activity(&$userdata)
$template->assign_vars(array(
'ACTIVE_FORUM' => $active_f_name,
- 'ACTIVE_FORUM_POSTS' => ($active_f_count == 1) ? sprintf($user->lang['USER_POST'], 1) : sprintf($user->lang['USER_POSTS'], $active_f_count),
+ 'ACTIVE_FORUM_POSTS' => $user->lang('USER_POSTS', (int) $active_f_count),
'ACTIVE_FORUM_PCT' => sprintf($l_active_pct, $active_f_pct),
'ACTIVE_TOPIC' => censor_text($active_t_name),
- 'ACTIVE_TOPIC_POSTS' => ($active_t_count == 1) ? sprintf($user->lang['USER_POST'], 1) : sprintf($user->lang['USER_POSTS'], $active_t_count),
+ 'ACTIVE_TOPIC_POSTS' => $user->lang('USER_POSTS', (int) $active_t_count),
'ACTIVE_TOPIC_PCT' => sprintf($l_active_pct, $active_t_pct),
'U_ACTIVE_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $active_f_id),
'U_ACTIVE_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $active_t_id),
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index 4c34bc9..8a15f80 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -1285,7 +1285,7 @@ function get_folder_status($folder_id, $folder)
'percent' => ($user->data['message_limit']) ? (($user->data['message_limit'] > 0) ? round(($folder['num_messages'] / $user->data['message_limit']) * 100) : 100) : 0,
);
- $return['message'] = sprintf($user->lang['FOLDER_STATUS_MSG'], $return['percent'], $return['cur'], $return['max']);
+ $return['message'] = $user->lang('FOLDER_STATUS_MSG', (int) $return['max'], $return['percent'], $return['cur']);
return $return;
}
diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php
index b70601b..c653117 100644
--- a/phpBB/includes/mcp/mcp_forum.php
+++ b/phpBB/includes/mcp/mcp_forum.php
@@ -128,7 +128,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
'PAGINATION' => generate_pagination($url . "&i=$id&action=$action&mode=$mode&sd=$sort_dir&sk=$sort_key&st=$sort_days" . (($merge_select) ? $selected_ids : ''), $forum_topics, $topics_per_page, $start),
'PAGE_NUMBER' => on_page($forum_topics, $topics_per_page, $start),
- 'TOTAL_TOPICS' => ($forum_topics == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $forum_topics),
+ 'TOTAL_TOPICS' => $user->lang('VIEW_FORUM_TOPICS', (int) $forum_topics),
));
// Grab icons
diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php
index af262ba..11f8c3c 100644
--- a/phpBB/includes/mcp/mcp_front.php
+++ b/phpBB/includes/mcp/mcp_front.php
@@ -126,22 +126,9 @@ function mcp_front_view($id, $mode, $action)
$template->assign_vars(array(
'S_HIDDEN_FIELDS' => $s_hidden_fields,
'S_MCP_QUEUE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue"),
+ 'L_UNAPPROVED_TOTAL' => $user->lang('UNAPPROVED_POSTS_TOTAL', (int) $total),
+ 'S_HAS_UNAPPROVED_POSTS'=> ($total != 0),
));
-
- if ($total == 0)
- {
- $template->assign_vars(array(
- 'L_UNAPPROVED_TOTAL' => $user->lang['UNAPPROVED_POSTS_ZERO_TOTAL'],
- 'S_HAS_UNAPPROVED_POSTS' => false)
- );
- }
- else
- {
- $template->assign_vars(array(
- 'L_UNAPPROVED_TOTAL' => ($total == 1) ? $user->lang['UNAPPROVED_POST_TOTAL'] : sprintf($user->lang['UNAPPROVED_POSTS_TOTAL'], $total),
- 'S_HAS_UNAPPROVED_POSTS' => true)
- );
- }
}
}
@@ -233,20 +220,10 @@ function mcp_front_view($id, $mode, $action)
}
}
- if ($total == 0)
- {
- $template->assign_vars(array(
- 'L_REPORTS_TOTAL' => $user->lang['REPORTS_ZERO_TOTAL'],
- 'S_HAS_REPORTS' => false)
- );
- }
- else
- {
- $template->assign_vars(array(
- 'L_REPORTS_TOTAL' => ($total == 1) ? $user->lang['REPORT_TOTAL'] : sprintf($user->lang['REPORTS_TOTAL'], $total),
- 'S_HAS_REPORTS' => true)
- );
- }
+ $template->assign_vars(array(
+ 'L_REPORTS_TOTAL' => $user->lang('REPORTS_TOTAL', (int) $total),
+ 'S_HAS_REPORTS' => ($total != 0),
+ ));
}
}
@@ -324,20 +301,10 @@ function mcp_front_view($id, $mode, $action)
}
}
- if ($total == 0)
- {
- $template->assign_vars(array(
- 'L_PM_REPORTS_TOTAL' => $user->lang['PM_REPORTS_ZERO_TOTAL'],
- 'S_HAS_PM_REPORTS' => false)
- );
- }
- else
- {
- $template->assign_vars(array(
- 'L_PM_REPORTS_TOTAL' => ($total == 1) ? $user->lang['PM_REPORT_TOTAL'] : sprintf($user->lang['PM_REPORTS_TOTAL'], $total),
- 'S_HAS_PM_REPORTS' => true)
- );
- }
+ $template->assign_vars(array(
+ 'L_PM_REPORTS_TOTAL' => $user->lang('PM_REPORTS_TOTAL', (int) $total),
+ 'S_HAS_PM_REPORTS' => ($total != 0),
+ ));
}
// Latest 5 logs
diff --git a/phpBB/includes/mcp/mcp_logs.php b/phpBB/includes/mcp/mcp_logs.php
index 73ff72c..bcf054e 100644
--- a/phpBB/includes/mcp/mcp_logs.php
+++ b/phpBB/includes/mcp/mcp_logs.php
@@ -174,7 +174,7 @@ class mcp_logs
$template->assign_vars(array(
'PAGE_NUMBER' => on_page($log_count, $config['topics_per_page'], $start),
- 'TOTAL' => ($log_count == 1) ? $user->lang['TOTAL_LOG'] : sprintf($user->lang['TOTAL_LOGS'], $log_count),
+ 'TOTAL' => $user->lang('TOTAL_LOGS', (int) $log_count),
'PAGINATION' => generate_pagination($this->u_action . "&$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start),
'L_TITLE' => $user->lang['MCP_LOGS'],
diff --git a/phpBB/includes/mcp/mcp_notes.php b/phpBB/includes/mcp/mcp_notes.php
index 02a89c0..4e61551 100644
--- a/phpBB/includes/mcp/mcp_notes.php
+++ b/phpBB/includes/mcp/mcp_notes.php
@@ -228,7 +228,7 @@ class mcp_notes
'PAGE_NUMBER' => on_page($log_count, $config['topics_per_page'], $start),
'PAGINATION' => generate_pagination($this->u_action . "&$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start),
- 'TOTAL_REPORTS' => ($log_count == 1) ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $log_count),
+ 'TOTAL_REPORTS' => $user->lang('LIST_REPORTS', (int) $log_count),
'RANK_TITLE' => $rank_title,
'JOINED' => $user->format_date($userrow['user_regdate']),
diff --git a/phpBB/includes/mcp/mcp_pm_reports.php b/phpBB/includes/mcp/mcp_pm_reports.php
index 72f77fa..095895b 100644
--- a/phpBB/includes/mcp/mcp_pm_reports.php
+++ b/phpBB/includes/mcp/mcp_pm_reports.php
@@ -310,7 +310,7 @@ class mcp_pm_reports
'PAGINATION' => generate_pagination($this->u_action . "&st=$sort_days&sk=$sort_key&sd=$sort_dir", $total, $config['topics_per_page'], $start),
'PAGE_NUMBER' => on_page($total, $config['topics_per_page'], $start),
'TOTAL' => $total,
- 'TOTAL_REPORTS' => ($total == 1) ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $total),
+ 'TOTAL_REPORTS' => $user->lang('LIST_REPORTS', (int) $total),
)
);
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index c419da5..e03f711 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -449,7 +449,7 @@ class mcp_queue
'PAGINATION' => generate_pagination($this->u_action . "&f=$forum_id&st=$sort_days&sk=$sort_key&sd=$sort_dir", $total, $config['topics_per_page'], $start),
'PAGE_NUMBER' => on_page($total, $config['topics_per_page'], $start),
'TOPIC_ID' => $topic_id,
- 'TOTAL' => ($total == 1) ? (($mode == 'unapproved_posts') ? $user->lang['VIEW_TOPIC_POST'] : $user->lang['VIEW_FORUM_TOPIC']) : sprintf((($mode == 'unapproved_posts') ? $user->lang['VIEW_TOPIC_POSTS'] : $user->lang['VIEW_FORUM_TOPICS']), $total),
+ 'TOTAL' => $user->lang((($mode == 'unapproved_posts') ? 'VIEW_TOPIC_POSTS' : 'VIEW_FORUM_TOPICS'), (int) $total),
));
$this->tpl_name = 'mcp_queue';
diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php
index 39d9fbd..1ca19ca 100644
--- a/phpBB/includes/mcp/mcp_reports.php
+++ b/phpBB/includes/mcp/mcp_reports.php
@@ -430,7 +430,7 @@ class mcp_reports
'PAGE_NUMBER' => on_page($total, $config['topics_per_page'], $start),
'TOPIC_ID' => $topic_id,
'TOTAL' => $total,
- 'TOTAL_REPORTS' => ($total == 1) ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $total),
+ 'TOTAL_REPORTS' => $user->lang('LIST_REPORTS', (int) $total),
)
);
diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php
index 76cd9be..186785c 100644
--- a/phpBB/includes/mcp/mcp_topic.php
+++ b/phpBB/includes/mcp/mcp_topic.php
@@ -336,7 +336,7 @@ function mcp_topic_view($id, $mode, $action)
'PAGE_NUMBER' => on_page($total, $posts_per_page, $start),
'PAGINATION' => (!$posts_per_page) ? '' : generate_pagination(append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&t={$topic_info['topic_id']}&mode=$mode&action=$action&to_topic_id=$to_topic_id&posts_per_page=$posts_per_page&st=$sort_days&sk=$sort_key&sd=$sort_dir"), $total, $posts_per_page, $start),
- 'TOTAL_POSTS' => ($total == 1) ? $user->lang['VIEW_TOPIC_POST'] : sprintf($user->lang['VIEW_TOPIC_POSTS'], $total),
+ 'TOTAL_POSTS' => $user->lang('VIEW_TOPIC_POSTS', (int) $total),
));
}
diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php
index 63e5b19..486c47b 100644
--- a/phpBB/includes/mcp/mcp_warn.php
+++ b/phpBB/includes/mcp/mcp_warn.php
@@ -185,7 +185,7 @@ class mcp_warn
'PAGE_NUMBER' => on_page($user_count, $config['topics_per_page'], $start),
'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}mcp.$phpEx", "i=warn&mode=list&st=$st&sk=$sk&sd=$sd"), $user_count, $config['topics_per_page'], $start),
- 'TOTAL_USERS' => ($user_count == 1) ? $user->lang['LIST_USER'] : sprintf($user->lang['LIST_USERS'], $user_count),
+ 'TOTAL_USERS' => $user->lang('LIST_USERS', (int) $user_count),
));
}
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index a134fab..0e9b8d7 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -772,7 +772,7 @@ class bbcode_firstpass extends bbcode
if ($config['max_quote_depth'] && sizeof($close_tags) >= $config['max_quote_depth'])
{
// there are too many nested quotes
- $error_ary['quote_depth'] = sprintf($user->lang['QUOTE_DEPTH_EXCEEDED'], $config['max_quote_depth']);
+ $error_ary['quote_depth'] = $user->lang('QUOTE_DEPTH_EXCEEDED', (int) $config['max_quote_depth']);
$out .= $buffer . $tok;
$tok = '[]';
diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php
index a6f7166..dc74262 100644
--- a/phpBB/includes/ucp/ucp_main.php
+++ b/phpBB/includes/ucp/ucp_main.php
@@ -663,8 +663,8 @@ class ucp_main
$template->assign_vars(array(
'PAGINATION' => generate_pagination($this->u_action, $topics_count, $config['topics_per_page'], $start),
'PAGE_NUMBER' => on_page($topics_count, $config['topics_per_page'], $start),
- 'TOTAL_TOPICS' => ($topics_count == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $topics_count))
- );
+ 'TOTAL_TOPICS' => $user->lang('VIEW_FORUM_TOPICS', (int) $topics_count),
+ ));
}
if ($mode == 'subscribed')
diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php
index c675928..e225613 100644
--- a/phpBB/includes/ucp/ucp_pm.php
+++ b/phpBB/includes/ucp/ucp_pm.php
@@ -345,8 +345,8 @@ class ucp_pm
'NUM_NOT_MOVED' => $num_not_moved,
'NUM_REMOVED' => $num_removed,
'RELEASE_MESSAGE_INFO' => sprintf($user->lang['RELEASE_MESSAGES'], '<a href="' . $this->u_action . '&amp;folder=' . $folder_id . '&amp;release=1">', '</a>'),
- 'NOT_MOVED_MESSAGES' => ($num_not_moved == 1) ? $user->lang['NOT_MOVED_MESSAGE'] : sprintf($user->lang['NOT_MOVED_MESSAGES'], $num_not_moved),
- 'RULE_REMOVED_MESSAGES' => ($num_removed == 1) ? $user->lang['RULE_REMOVED_MESSAGE'] : sprintf($user->lang['RULE_REMOVED_MESSAGES'], $num_removed),
+ 'NOT_MOVED_MESSAGES' => $user->lang('NOT_MOVED_MESSAGES', (int) $num_not_moved),
+ 'RULE_REMOVED_MESSAGES' => $user->lang('RULE_REMOVED_MESSAGES', (int) $num_removed),
'S_FOLDER_OPTIONS' => $s_folder_options,
'S_TO_FOLDER_OPTIONS' => $s_to_folder_options,
diff --git a/phpBB/includes/ucp/ucp_pm_options.php b/phpBB/includes/ucp/ucp_pm_options.php
index 58c2d08..26aaa2e 100644
--- a/phpBB/includes/ucp/ucp_pm_options.php
+++ b/phpBB/includes/ucp/ucp_pm_options.php
@@ -409,7 +409,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
$folder[PRIVMSGS_INBOX] = array(
'folder_name' => $user->lang['PM_INBOX'],
- 'message_status' => sprintf($user->lang['FOLDER_MESSAGE_STATUS'], $num_messages, $user->data['message_limit'])
+ 'message_status' => $user->lang('FOLDER_MESSAGE_STATUS', (int) $user->data['message_limit'], $num_messages),
);
$sql = 'SELECT folder_id, folder_name, pm_count
@@ -423,7 +423,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
$num_user_folder++;
$folder[$row['folder_id']] = array(
'folder_name' => $row['folder_name'],
- 'message_status' => sprintf($user->lang['FOLDER_MESSAGE_STATUS'], $row['pm_count'], $user->data['message_limit'])
+ 'message_status' => $user->lang('FOLDER_MESSAGE_STATUS', (int) $user->data['message_limit'], $row['pm_count']),
);
}
$db->sql_freeresult($result);
diff --git a/phpBB/includes/ucp/ucp_pm_viewfolder.php b/phpBB/includes/ucp/ucp_pm_viewfolder.php
index bd7bf89..7ae8d20 100644
--- a/phpBB/includes/ucp/ucp_pm_viewfolder.php
+++ b/phpBB/includes/ucp/ucp_pm_viewfolder.php
@@ -455,7 +455,7 @@ function get_pm_from($folder_id, $folder, $user_id)
$template->assign_vars(array(
'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&amp;mode=view&amp;action=view_folder&amp;f=$folder_id&amp;$u_sort_param"), $pm_count, $config['topics_per_page'], $start),
'PAGE_NUMBER' => on_page($pm_count, $config['topics_per_page'], $start),
- 'TOTAL_MESSAGES' => (($pm_count == 1) ? $user->lang['VIEW_PM_MESSAGE'] : sprintf($user->lang['VIEW_PM_MESSAGES'], $pm_count)),
+ 'TOTAL_MESSAGES' => $user->lang('VIEW_PM_MESSAGES', (int) $pm_count),
'POST_IMG' => (!$auth->acl_get('u_sendpm')) ? $user->img('button_topic_locked', 'POST_PM_LOCKED') : $user->img('button_pm_new', 'POST_NEW_PM'),
diff --git a/phpBB/index.php b/phpBB/index.php
index 0105a0a..5e11de8 100644
--- a/phpBB/index.php
+++ b/phpBB/index.php
@@ -27,15 +27,6 @@ $user->setup('viewforum');
display_forums('', $config['load_moderators']);
-// Set some stats, get posts count from forums data if we... hum... retrieve all forums data
-$total_posts = $config['num_posts'];
-$total_topics = $config['num_topics'];
-$total_users = $config['num_users'];
-
-$l_total_user_s = ($total_users == 0) ? 'TOTAL_USERS_ZERO' : 'TOTAL_USERS_OTHER';
-$l_total_post_s = ($total_posts == 0) ? 'TOTAL_POSTS_ZERO' : 'TOTAL_POSTS_OTHER';
-$l_total_topic_s = ($total_topics == 0) ? 'TOTAL_TOPICS_ZERO' : 'TOTAL_TOPICS_OTHER';
-
// Grab group details for legend display
if ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel'))
{
@@ -115,9 +106,9 @@ if ($config['load_birthdays'] && $config['allow_birthdays'] && $auth->acl_gets('
// Assign index specific vars
$template->assign_vars(array(
- 'TOTAL_POSTS' => sprintf($user->lang[$l_total_post_s], $total_posts),
- 'TOTAL_TOPICS' => sprintf($user->lang[$l_total_topic_s], $total_topics),
- 'TOTAL_USERS' => sprintf($user->lang[$l_total_user_s], $total_users),
+ 'TOTAL_POSTS' => $user->lang('TOTAL_POSTS', (int) $config['num_posts']),
+ 'TOTAL_TOPICS' => $user->lang('TOTAL_TOPICS', (int) $config['num_topics']),
+ 'TOTAL_USERS' => $user->lang('TOTAL_USERS', (int) $config['num_users']),
'NEWEST_USER' => sprintf($user->lang['NEWEST_USER'], get_username_string('full', $config['newest_user_id'], $config['newest_username'], $config['newest_user_colour'])),
'LEGEND' => $legend,
diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php
index acd034c..66c634e 100644
--- a/phpBB/language/en/common.php
+++ b/phpBB/language/en/common.php
@@ -113,8 +113,11 @@ $lang = array_merge($lang, array(
'BOARD_DISABLED' => 'This board is currently disabled.',
'BOARD_UNAVAILABLE' => 'Sorry but the board is temporarily unavailable, please try again in a few minutes.',
'BROWSING_FORUM' => 'Users browsing this forum: %1$s',
- 'BROWSING_FORUM_GUEST' => 'Users browsing this forum: %1$s and %2$d guest',
- 'BROWSING_FORUM_GUESTS' => 'Users browsing this forum: %1$s and %2$d guests',
+ 'BROWSING_FORUM_GUESTS' => array(
+ 0 => 'Users browsing this forum: %2$s and 0 guests',
+ 1 => 'Users browsing this forum: %2$s and %1$d guest',
+ 2 => 'Users browsing this forum: %2$s and %1$d guests',
+ ),
'BYTES' => 'Bytes',
'CANCEL' => 'Cancel',
@@ -155,12 +158,11 @@ $lang = array_merge($lang, array(
'DISPLAY_TOPICS' => 'Display topics from previous',
'DOWNLOADED' => 'Downloaded',
'DOWNLOADING_FILE' => 'Downloading file',
- 'DOWNLOAD_COUNT' => 'Downloaded %d time',
- 'DOWNLOAD_COUNTS' => 'Downloaded %d times',
- 'DOWNLOAD_COUNT_NONE' => 'Not downloaded yet',
- 'VIEWED_COUNT' => 'Viewed %d time',
- 'VIEWED_COUNTS' => 'Viewed %d times',
- 'VIEWED_COUNT_NONE' => 'Not viewed yet',
+ 'DOWNLOAD_COUNTS' => array(
+ 0 => 'Not downloaded yet',
+ 1 => 'Downloaded %d time',
+ 2 => 'Downloaded %d times',
+ ),
'EDIT_POST' => 'Edit post',
'EMAIL' => 'E-mail', // Short form for EMAIL_ADDRESS
@@ -243,12 +245,16 @@ $lang = array_merge($lang, array(
'GROUP_ERR_USERNAME' => 'No group name specified.',
'GROUP_ERR_USER_LONG' => 'Group names cannot exceed 60 characters. The specified group name is too long.',
'GUEST' => 'Guest',
- 'GUEST_USERS_ONLINE' => 'There are %d guest users online',
- 'GUEST_USERS_TOTAL' => '%d guests',
- 'GUEST_USERS_ZERO_ONLINE' => 'There are 0 guest users online',
- 'GUEST_USERS_ZERO_TOTAL' => '0 guests',
- 'GUEST_USER_ONLINE' => 'There is %d guest user online',
- 'GUEST_USER_TOTAL' => '%d guest',
+ 'GUEST_USERS_ONLINE' => array(
+ 0 => 'There are 0 guest users online',
+ 1 => 'There is %d guest user online',
+ 2 => 'There are %d guest users online',
+ ),
+ 'GUEST_USERS_TOTAL' => array(
+ 0 => '0 guests',
+ 1 => '%d guest',
+ 2 => '%d guests',
+ ),
'G_ADMINISTRATORS' => 'Administrators',
'G_BOTS' => 'Bots',
'G_GUESTS' => 'Guests',
@@ -257,15 +263,16 @@ $lang = array_merge($lang, array(
'G_GLOBAL_MODERATORS' => 'Global moderators',
'G_NEWLY_REGISTERED' => 'Newly registered users',
- 'HIDDEN_USERS_ONLINE' => '%d hidden users online',
- 'HIDDEN_USERS_TOTAL' => '%d hidden',
- 'HIDDEN_USERS_TOTAL_AND' => '%d hidden and ',
- 'HIDDEN_USERS_ZERO_ONLINE' => '0 hidden users online',
- 'HIDDEN_USERS_ZERO_TOTAL' => '0 hidden',
- 'HIDDEN_USERS_ZERO_TOTAL_AND' => '0 hidden and ',
- 'HIDDEN_USER_ONLINE' => '%d hidden user online',
- 'HIDDEN_USER_TOTAL' => '%d hidden',
- 'HIDDEN_USER_TOTAL_AND' => '%d hidden and ',
+ 'HIDDEN_USERS_ONLINE' => array(
+ 0 => '0 hidden users',
+ 1 => '%d hidden user',
+ 2 => '%d hidden users',
+ ),
+ 'HIDDEN_USERS_TOTAL' => array(
+ 0 => '0 hidden',
+ 1 => '%d hidden',
+ 2 => '%d hidden',
+ ),
'HIDE_GUESTS' => 'Hide guests',
'HIDE_ME' => 'Hide my online status this session',
'HOURS' => 'Hours',
@@ -352,8 +359,11 @@ $lang = array_merge($lang, array(
'NEWEST_USER' => 'Our newest member <strong>%s</strong>',
'NEW_MESSAGE' => 'New message',
'NEW_MESSAGES' => 'New messages',
- 'NEW_PM' => '<strong>%d</strong> new message',
- 'NEW_PMS' => '<strong>%d</strong> new messages',
+ 'NEW_PMS' => array(
+ 0 => '<strong>0</strong> new messages',
+ 1 => '<strong>%d</strong> new message',
+ 2 => '<strong>%d</strong> new messages',
+ ),
'NEW_POST' => 'New post', // Not used anymore
'NEW_POSTS' => 'New posts', // Not used anymore
'NEXT' => 'Next', // Used in pagination
@@ -387,7 +397,6 @@ $lang = array_merge($lang, array(
'NO_MODE' => 'No mode specified.',
'NO_MODERATORS' => 'There are no moderators.',
'NO_NEW_MESSAGES' => 'No new messages',
- 'NO_NEW_PM' => '<strong>0</strong> new messages',
'NO_NEW_POSTS' => 'No new posts', // Not used anymore
'NO_ONLINE_USERS' => 'No registered users',
'NO_POSTS' => 'No posts',
@@ -401,7 +410,6 @@ $lang = array_merge($lang, array(
'NO_TOPIC_FORUM' => 'The topic or forum no longer exists.',
'NO_TOPICS' => 'There are no topics or posts in this forum.',
'NO_TOPICS_TIME_FRAME' => 'No topics exist inside this forum for the selected time frame.',
- 'NO_UNREAD_PM' => '<strong>0</strong> unread messages',
'NO_UNREAD_POSTS' => 'No unread posts',
'NO_UPLOAD_FORM_FOUND' => 'Upload initiated but no valid file upload form found.',
'NO_USER' => 'The requested user does not exist.',
@@ -419,9 +427,18 @@ $lang = array_merge($lang, array(
'OFFLINE' => 'Offline',
'ONLINE' => 'Online',
'ONLINE_BUDDIES' => 'Online friends',
- 'ONLINE_USERS_TOTAL' => 'In total there are <strong>%d</strong> users online :: ',
- 'ONLINE_USERS_ZERO_TOTAL' => 'In total there are <strong>0</strong> users online :: ',
- 'ONLINE_USER_TOTAL' => 'In total there is <strong>%d</strong> user online :: ',
+ // "... :: x registered and y hidden"
+ 'ONLINE_USERS_TOTAL' => array(
+ 0 => 'In total there are <strong>0</strong> users online :: %2$s and %3$s',
+ 1 => 'In total there is <strong>%1$d</strong> user online :: %2$s and %3$s',
+ 2 => 'In total there are <strong>%1$d</strong> users online :: %2$s and %3$s',
+ ),
+ // "... :: x registered, y hidden and z guests"
+ 'ONLINE_USERS_TOTAL_GUESTS' => array(
+ 0 => 'In total there are <strong>0</strong> users online :: %2$s, %3$s and %4$s',
+ 1 => 'In total there is <strong>%1$d</strong> user online :: %2$s, %3$s and %4$s',
+ 2 => 'In total there are <strong>%1$d</strong> users online :: %2$s, %3$s and %4$s',
+ ),
'OPTIONS' => 'Options',
'PAGE_OF' => 'Page <strong>%1$d</strong> of <strong>%2$d</strong>',
@@ -474,15 +491,17 @@ $lang = array_merge($lang, array(
'REDIRECTS' => 'Total redirects',
'REGISTER' => 'Register',
'REGISTERED_USERS' => 'Registered users:',
- 'REG_USERS_ONLINE' => 'There are %d registered users and ',
- 'REG_USERS_TOTAL' => '%d registered, ',
- 'REG_USERS_TOTAL_AND' => '%d registered and ',
- 'REG_USERS_ZERO_ONLINE' => 'There are 0 registered users and ',
- 'REG_USERS_ZERO_TOTAL' => '0 registered, ',
- 'REG_USERS_ZERO_TOTAL_AND' => '0 registered and ',
- 'REG_USER_ONLINE' => 'There is %d registered user and ',
- 'REG_USER_TOTAL' => '%d registered, ',
- 'REG_USER_TOTAL_AND' => '%d registered and ',
+ // "... and 2 hidden users online"
+ 'REG_USERS_ONLINE' => array(
+ 0 => 'There are 0 registered users and %2$s online',
+ 1 => 'There is %1$d registered user and %2$s online',
+ 2 => 'There are %1$d registered users and %2$s online',
+ ),
+ 'REG_USERS_TOTAL' => array(
+ 0 => '0 registered',
+ 1 => '%d registered',
+ 2 => '%d registered',
+ ),
'REMOVE' => 'Remove',
'REMOVE_INSTALL' => 'Please delete, move or rename the install directory before you use your board. If this directory is still present, only the Administration Control Panel (ACP) will be accessible.',
'REPLIES' => 'Replies',
@@ -634,19 +653,33 @@ $lang = array_merge($lang, array(
'TOPIC_TITLE' => 'Topic title',
'TOPIC_UNAPPROVED' => 'This topic has not been approved',
'TOTAL_ATTACHMENTS' => 'Attachment(s)',
- 'TOTAL_LOG' => '1 log',
- 'TOTAL_LOGS' => '%d logs',
- 'TOTAL_NO_PM' => '0 private messages in total',
- 'TOTAL_PM' => '1 private message in total',
- 'TOTAL_PMS' => '%d private messages in total',
+ 'TOTAL_LOGS' => array(
+ 0 => '0 logs',
+ 1 => '%d log',
+ 2 => '%d logs',
+ ),
+ 'TOTAL_PMS' => array(
+ 0 => '0 private messages in total',
+ 1 => '%d private message in total',
+ 2 => '%d private messages in total',
+ ),
'TOTAL_POSTS' => 'Total posts',
- 'TOTAL_POSTS_OTHER' => 'Total posts <strong>%d</strong>',
- 'TOTAL_POSTS_ZERO' => 'Total posts <strong>0</strong>',
+ 'TOTAL_POSTS_COUNT' => array(
+ 0 => 'Total posts <strong>0</strong>',
+ 1 => 'Total posts <strong>%d</strong>',
+ 2 => 'Total posts <strong>%d</strong>',
+ ),
'TOPIC_REPORTED' => 'This topic has been reported',
- 'TOTAL_TOPICS_OTHER'=> 'Total topics <strong>%d</strong>',
- 'TOTAL_TOPICS_ZERO' => 'Total topics <strong>0</strong>',
- 'TOTAL_USERS_OTHER' => 'Total members <strong>%d</strong>',
- 'TOTAL_USERS_ZERO' => 'Total members <strong>0</strong>',
+ 'TOTAL_TOPICS' => array(
+ 0 => 'Total topics <strong>0</strong>',
+ 1 => 'Total topics <strong>%d</strong>',
+ 2 => 'Total topics <strong>%d</strong>',
+ ),
+ 'TOTAL_USERS' => array(
+ 0 => 'Total members <strong>0</strong>',
+ 1 => 'Total members <strong>%d</strong>',
+ 2 => 'Total members <strong>%d</strong>',
+ ),
'TRACKED_PHP_ERROR' => 'Tracked PHP errors: %s',
'UNABLE_GET_IMAGE_SIZE' => 'It was not possible to determine the dimensions of the image.',
@@ -654,8 +687,11 @@ $lang = array_merge($lang, array(
'UNKNOWN_BROWSER' => 'Unknown browser',
'UNMARK_ALL' => 'Unmark all',
'UNREAD_MESSAGES' => 'Unread messages',
- 'UNREAD_PM' => '<strong>%d</strong> unread message',
- 'UNREAD_PMS' => '<strong>%d</strong> unread messages',
+ 'UNREAD_PMS' => array(
+ 0 => '<strong>0</strong> unread messages',
+ 1 => '<strong>%d</strong> unread message',
+ 2 => '<strong>%d</strong> unread messages',
+ ),
'UNREAD_POST' => 'Unread post',
'UNREAD_POSTS' => 'Unread posts',
'UNWATCH_FORUM_CONFIRM' => 'Are you sure you wish to unsubscribe from this forum?',
@@ -673,8 +709,11 @@ $lang = array_merge($lang, array(
'USERNAMES' => 'Usernames',
'USER_AVATAR' => 'User avatar',
'USER_CANNOT_READ' => 'You cannot read posts in this forum.',
- 'USER_POST' => '%d Post',
- 'USER_POSTS' => '%d Posts',
+ 'USER_POSTS' => array(
+ 0 => '0 Posts',
+ 1 => '%d Post',
+ 2 => '%d Posts',
+ ),
'USERS' => 'Users',
'USE_PERMISSIONS' => 'Test out user’s permissions',
@@ -682,6 +721,11 @@ $lang = array_merge($lang, array(
'VARIANT_DATE_SEPARATOR' => ' / ', // Used in date format dropdown, eg: "Today, 13:37 / 01 Jan 2007, 13:37" ... to join a relative date with calendar date
'VIEWED' => 'Viewed',
+ 'VIEWED_COUNTS' => array(
+ 0 => 'Not viewed yet',
+ 1 => 'Viewed %d time',
+ 2 => 'Viewed %d times',
+ ),
'VIEWING_FAQ' => 'Viewing FAQ',
'VIEWING_MEMBERS' => 'Viewing member details',
'VIEWING_ONLINE' => 'Viewing who is online',
@@ -696,8 +740,11 @@ $lang = array_merge($lang, array(
'VIEW_LATEST_POST' => 'View the latest post',
'VIEW_NEWEST_POST' => 'View first unread post',
'VIEW_NOTES' => 'View user notes',
- 'VIEW_ONLINE_TIME' => 'based on users active over the past %d minute',
- 'VIEW_ONLINE_TIMES' => 'based on users active over the past %d minutes',
+ 'VIEW_ONLINE_TIMES' => array(
+ 0 => 'based on users active over the past %d minutes',
+ 1 => 'based on users active over the past %d minute',
+ 2 => 'based on users active over the past %d minutes',
+ ),
'VIEW_TOPIC' => 'View topic',
'VIEW_TOPIC_ANNOUNCEMENT' => 'Announcement: ',
'VIEW_TOPIC_GLOBAL' => 'Global Announcement: ',
diff --git a/phpBB/language/en/mcp.php b/phpBB/language/en/mcp.php
index d0bcec0..aaa25dc 100644
--- a/phpBB/language/en/mcp.php
+++ b/phpBB/language/en/mcp.php
@@ -120,8 +120,11 @@ $lang = array_merge($lang, array(
'LATEST_WARNING_TIME' => 'Latest warning issued',
'LATEST_WARNINGS' => 'Latest 5 warnings',
'LEAVE_SHADOW' => 'Leave shadow topic in place',
- 'LIST_REPORT' => '1 report',
- 'LIST_REPORTS' => '%d reports',
+ 'LIST_REPORTS' => array(
+ 0 => '%d reports',
+ 1 => '%d report',
+ 2 => '%d reports',
+ ),
'LOCK' => 'Lock',
'LOCK_POST_POST' => 'Lock post',
'LOCK_POST_POST_CONFIRM' => 'Are you sure you want to prevent editing this post?',
@@ -251,11 +254,13 @@ $lang = array_merge($lang, array(
'PM_REPORT_CLOSED_SUCCESS' => 'The selected PM report has been closed successfully.',
'PM_REPORT_DELETED_SUCCESS' => 'The selected PM report has been deleted successfully.',
'PM_REPORTED_SUCCESS' => 'This private message has been successfully reported.',
- 'PM_REPORT_TOTAL' => 'In total there is <strong>1</strong> PM report to review.',
'PM_REPORTS_CLOSED_SUCCESS' => 'The selected PM reports have been closed successfully.',
'PM_REPORTS_DELETED_SUCCESS'=> 'The selected PM reports have been deleted successfully.',
- 'PM_REPORTS_TOTAL' => 'In total there are <strong>%d</strong> PM reports to review.',
- 'PM_REPORTS_ZERO_TOTAL' => 'There are no PM reports to review.',
+ 'PM_REPORTS_TOTAL' => array(
+ 0 => 'There are no PM reports to review.',
+ 1 => 'In total there is <strong>1</strong> PM report to review.',
+ 2 => 'In total there are <strong>%d</strong> PM reports to review.',
+ ),
'PM_REPORT_DETAILS' => 'Private message report details',
'POSTER' => 'Poster',
'POSTS_APPROVED_SUCCESS' => 'The selected posts have been approved.',
@@ -282,8 +287,11 @@ $lang = array_merge($lang, array(
'REPORTED_ON_DATE' => 'on',
'REPORTS_CLOSED_SUCCESS' => 'The selected reports have been closed successfully.',
'REPORTS_DELETED_SUCCESS' => 'The selected reports have been deleted successfully.',
- 'REPORTS_TOTAL' => 'In total there are <strong>%d</strong> reports to review.',
- 'REPORTS_ZERO_TOTAL' => 'There are no reports to review.',
+ 'REPORTS_TOTAL' => array(
+ 0 => 'There are no reports to review.',
+ 1 => 'In total there is <strong>1</strong> report to review.',
+ 2 => 'In total there are <strong>%d</strong> reports to review.',
+ ),
'REPORT_CLOSED' => 'This report has already been closed.',
'REPORT_CLOSED_SUCCESS' => 'The selected report has been closed successfully.',
'REPORT_DELETED_SUCCESS' => 'The selected report has been deleted successfully.',
@@ -295,7 +303,6 @@ $lang = array_merge($lang, array(
'REPORT_POST_EXPLAIN' => 'Use this form to report the selected post to the forum moderators and board administrators. Reporting should generally be used only if the post breaks forum rules.',
'REPORT_REASON' => 'Report reason',
'REPORT_TIME' => 'Report time',
- 'REPORT_TOTAL' => 'In total there is <strong>1</strong> report to review.',
'RESYNC' => 'Resync',
'RETURN_MESSAGE' => '%sReturn to the message%s',
'RETURN_NEW_FORUM' => '%sGo to the new forum%s',
@@ -353,9 +360,11 @@ $lang = array_merge($lang, array(
'TOPIC_UNLOCKED_SUCCESS' => 'The selected topic has been unlocked.',
'TOTAL_WARNINGS' => 'Total Warnings',
- 'UNAPPROVED_POSTS_TOTAL' => 'In total there are <strong>%d</strong> posts waiting for approval.',
- 'UNAPPROVED_POSTS_ZERO_TOTAL' => 'There are no posts waiting for approval.',
- 'UNAPPROVED_POST_TOTAL' => 'In total there is <strong>1</strong> post waiting for approval.',
+ 'UNAPPROVED_POSTS_TOTAL' => array(
+ 0 => 'There are no posts waiting for approval.',
+ 1 => 'In total there is <strong>1</strong> post waiting for approval.',
+ 2 => 'In total there are <strong>%d</strong> posts waiting for approval.',
+ ),
'UNLOCK' => 'Unlock',
'UNLOCK_POST' => 'Unlock post',
'UNLOCK_POST_EXPLAIN' => 'Allow editing',
diff --git a/phpBB/language/en/memberlist.php b/phpBB/language/en/memberlist.php
index e71f9d6..6237d00 100644
--- a/phpBB/language/en/memberlist.php
+++ b/phpBB/language/en/memberlist.php
@@ -93,8 +93,11 @@ $lang = array_merge($lang, array(
'LAST_ACTIVE' => 'Last active',
'LESS_THAN' => 'Less than',
- 'LIST_USER' => '1 user',
- 'LIST_USERS' => '%d users',
+ 'LIST_USERS' => array(
+ 0 => '0 users',
+ 1 => '%d user',
+ 2 => '%d users',
+ ),
'LOGIN_EXPLAIN_LEADERS' => 'The board requires you to be registered and logged in to view the team listing.',
'LOGIN_EXPLAIN_MEMBERLIST' => 'The board requires you to be registered and logged in to access the memberlist.',
'LOGIN_EXPLAIN_SEARCHUSER' => 'The board requires you to be registered and logged in to search users.',
@@ -136,6 +139,7 @@ $lang = array_merge($lang, array(
'USER_LAST_REMINDED' => array(
0 => 'No reminder sent at this time',
1 => '%1$d reminder sent<br />» %2$s',
+ 2 => '%1$d reminder sent<br />» %2$s',
),
'USER_ONLINE' => 'Online',
'USER_PRESENCE' => 'Board presence',
diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php
index f8d265d..89e14a3 100644
--- a/phpBB/language/en/posting.php
+++ b/phpBB/language/en/posting.php
@@ -149,8 +149,16 @@ $lang = array_merge($lang, array(
'POLL_MAX_OPTIONS' => 'Options per user',
'POLL_MAX_OPTIONS_EXPLAIN' => 'This is the number of options each user may select when voting.',
'POLL_OPTIONS' => 'Poll options',
- 'POLL_OPTIONS_EXPLAIN' => 'Place each option on a new line. You may enter up to <strong>%d</strong> options.',
- 'POLL_OPTIONS_EDIT_EXPLAIN' => 'Place each option on a new line. You may enter up to <strong>%d</strong> options. If you remove or add options all previous votes will be reset.',
+ 'POLL_OPTIONS_EXPLAIN' => array(
+ 0 => 'Place each option on a new line. You may enter up to <strong>%d</strong> options.',
+ 1 => 'Place each option on a new line. You may enter <strong>%d</strong> option.',
+ 2 => 'Place each option on a new line. You may enter up to <strong>%d</strong> options.',
+ ),
+ 'POLL_OPTIONS_EDIT_EXPLAIN' => array(
+ 0 => 'Place each option on a new line. You may enter up to <strong>%d</strong> options. If you remove or add options all previous votes will be reset.',
+ 1 => 'Place each option on a new line. You may enter <strong>%d</strong> option. If you remove or add options all previous votes will be reset.',
+ 2 => 'Place each option on a new line. You may enter up to <strong>%d</strong> options. If you remove or add options all previous votes will be reset.',
+ ),
'POLL_QUESTION' => 'Poll question',
'POLL_TITLE_TOO_LONG' => 'The poll title must contain fewer than 100 characters.',
'POLL_TITLE_COMP_TOO_LONG' => 'The parsed size of your poll title is too large, consider removing BBCodes or smilies.',
@@ -175,7 +183,11 @@ $lang = array_merge($lang, array(
'POST_TOPIC_AS' => 'Post topic as',
'PROGRESS_BAR' => 'Progress bar',
- 'QUOTE_DEPTH_EXCEEDED' => 'You may embed only %1$d quotes within each other.',
+ 'QUOTE_DEPTH_EXCEEDED' => array(
+ 0 => 'You may embed only %d quotes within each other.',
+ 1 => 'You may embed only %d quote within each other.',
+ 2 => 'You may embed only %d quotes within each other.',
+ ),
'SAVE' => 'Save',
'SAVE_DATE' => 'Saved at',
diff --git a/phpBB/language/en/search.php b/phpBB/language/en/search.php
index cd38cd6..eac67bf 100644
--- a/phpBB/language/en/search.php
+++ b/phpBB/language/en/search.php
@@ -41,9 +41,16 @@ $lang = array_merge($lang, array(
'DISPLAY_RESULTS' => 'Display results as',
- 'FOUND_SEARCH_MATCH' => 'Search found %d match',
- 'FOUND_SEARCH_MATCHES' => 'Search found %d matches',
- 'FOUND_MORE_SEARCH_MATCHES' => 'Search found more than %d matches',
+ 'FOUND_SEARCH_MATCHES' => array(
+ 0 => 'Search found %d matches',
+ 1 => 'Search found %d match',
+ 2 => 'Search found %d matches',
+ ),
+ 'FOUND_MORE_SEARCH_MATCHES' => array(
+ 0 => 'Search found more than %d matches',
+ 1 => 'Search found more than %d match',
+ 2 => 'Search found more than %d matches',
+ ),
'GLOBAL' => 'Global announcement',
@@ -100,7 +107,11 @@ $lang = array_merge($lang, array(
'SORT_POST_SUBJECT' => 'Post subject',
'SORT_TIME' => 'Post time',
- 'TOO_FEW_AUTHOR_CHARS' => 'You must specify at least %d characters of the authors name.',
+ 'TOO_FEW_AUTHOR_CHARS' => array(
+ 0 => 'You must specify at least %d characters of the authors name.',
+ 1 => 'You must specify at least %d character of the authors name.',
+ 2 => 'You must specify at least %d characters of the authors name.',
+ ),
));
?>
\ No newline at end of file
diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php
index c1e3c06..181b6bd 100644
--- a/phpBB/language/en/ucp.php
+++ b/phpBB/language/en/ucp.php
@@ -201,13 +201,21 @@ $lang = array_merge($lang, array(
'FOES_EXPLAIN' => 'Foes are users which will be ignored by default. Posts by these users will not be fully visible. Personal messages from foes are still permitted. Please note that you cannot ignore moderators or administrators.',
'FOES_UPDATED' => 'Your foes list has been updated successfully.',
'FOLDER_ADDED' => 'Folder successfully added.',
- 'FOLDER_MESSAGE_STATUS' => '%1$d from %2$d messages stored',
+ 'FOLDER_MESSAGE_STATUS' => array(
+ 0 => '%2$d from %1$d messages stored',
+ 1 => '%2$d from %1$d message stored',
+ 2 => '%2$d from %1$d messages stored',
+ ),
'FOLDER_NAME_EMPTY' => 'You must enter a name for this folder.',
'FOLDER_NAME_EXIST' => 'Folder <strong>%s</strong> already exists.',
'FOLDER_OPTIONS' => 'Folder options',
'FOLDER_RENAMED' => 'Folder successfully renamed.',
'FOLDER_REMOVED' => 'Folder successfully removed.',
- 'FOLDER_STATUS_MSG' => 'Folder is %1$d%% full (%2$d from %3$d messages stored)',
+ 'FOLDER_STATUS_MSG' => array(
+ 0 => 'Folder is %3$d%% full (%2$d from %1$d messages stored)',
+ 1 => 'Folder is %3$d%% full (%2$d from %1$d message stored)',
+ 2 => 'Folder is %3$d%% full (%2$d from %1$d messages stored)',
+ ),
'FORWARD_PM' => 'Forward PM',
'FORCE_PASSWORD_EXPLAIN' => 'Before you may continue browsing the board you are required to change your password.',
'FRIEND_MESSAGE' => 'Message from friend',
@@ -289,8 +297,11 @@ $lang = array_merge($lang, array(
'NOT_ADDED_FOES_SELF' => 'You cannot add yourself to the foes list.',
'NOT_AGREE' => 'I do not agree to these terms',
'NOT_ENOUGH_SPACE_FOLDER' => 'The destination folder “%s” seems to be full. The requested action has not been taken.',
- 'NOT_MOVED_MESSAGE' => 'You have 1 private message currently on hold because of full folder.',
- 'NOT_MOVED_MESSAGES' => 'You have %d private messages currently on hold because of full folder.',
+ 'NOT_MOVED_MESSAGES' => array(
+ 0 => 'You have %d private messages currently on hold because of full folder.',
+ 1 => 'You have %d private message currently on hold because of full folder.',
+ 2 => 'You have %d private messages currently on hold because of full folder.',
+ ),
'NO_ACTION_MODE' => 'No message action specified.',
'NO_AUTHOR' => 'No author defined for this message',
'NO_AVATAR_CATEGORY' => 'None',
@@ -385,8 +396,11 @@ $lang = array_merge($lang, array(
'RULE_ALREADY_DEFINED' => 'This rule was defined previously.',
'RULE_DELETED' => 'Rule successfully removed.',
'RULE_NOT_DEFINED' => 'Rule not correctly specified.',
- 'RULE_REMOVED_MESSAGE' => 'One private message had been removed due to private message filters.',
- 'RULE_REMOVED_MESSAGES' => '%d private messages were removed due to private message filters.',
+ 'RULE_REMOVED_MESSAGES' => array(
+ 0 => '%d private messages were removed due to private message filters.',
+ 1 => '%d private message was removed due to private message filters.',
+ 2 => '%d private messages were removed due to private message filters.',
+ ),
'SAME_PASSWORD_ERROR' => 'The new password you entered is the same as your current password.',
'SEARCH_YOUR_POSTS' => 'Show your posts',
@@ -486,8 +500,11 @@ $lang = array_merge($lang, array(
'VIEW_NEXT_PM' => 'Next PM',
'VIEW_PM' => 'View message',
'VIEW_PM_INFO' => 'Message details',
- 'VIEW_PM_MESSAGE' => '1 message',
- 'VIEW_PM_MESSAGES' => '%d messages',
+ 'VIEW_PM_MESSAGES' => array(
+ 0 => '%d messages',
+ 1 => '%d message',
+ 2 => '%d messages',
+ ),
'VIEW_PREVIOUS_HISTORY' => 'Previous PM in history',
'VIEW_PREVIOUS_PM' => 'Previous PM',
'VIEW_SIGS' => 'Display signatures',
diff --git a/phpBB/language/en/viewforum.php b/phpBB/language/en/viewforum.php
index d2fae20..929820f 100644
--- a/phpBB/language/en/viewforum.php
+++ b/phpBB/language/en/viewforum.php
@@ -64,8 +64,11 @@ $lang = array_merge($lang, array(
'UNREAD_POSTS_LOCKED' => 'Unread posts [ Locked ]',
'VIEW_FORUM' => 'View forum',
- 'VIEW_FORUM_TOPIC' => '1 topic',
- 'VIEW_FORUM_TOPICS' => '%d topics',
+ 'VIEW_FORUM_TOPICS' => array(
+ 0 => '%d topics',
+ 1 => '%d topic',
+ 2 => '%d topics',
+ ),
));
?>
\ No newline at end of file
diff --git a/phpBB/language/en/viewtopic.php b/phpBB/language/en/viewtopic.php
index 3e1874f..1bb7e45 100644
--- a/phpBB/language/en/viewtopic.php
+++ b/phpBB/language/en/viewtopic.php
@@ -53,8 +53,11 @@ $lang = array_merge($lang, array(
'DELETE_TOPIC' => 'Delete topic',
'DOWNLOAD_NOTICE' => 'You do not have the required permissions to view the files attached to this post.',
- 'EDITED_TIMES_TOTAL' => 'Last edited by %1$s on %2$s, edited %3$d times in total.',
- 'EDITED_TIME_TOTAL' => 'Last edited by %1$s on %2$s, edited %3$d time in total.',
+ 'EDITED_TIMES_TOTAL' => array(
+ 0 => 'Last edited by %2$s on %3$s, edited %1$d times in total.',
+ 1 => 'Last edited by %2$s on %3$s, edited %1$d time in total.',
+ 2 => 'Last edited by %2$s on %3$s, edited %1$d times in total.',
+ )
'EMAIL_TOPIC' => 'E-mail friend',
'ERROR_NO_ATTACHMENT' => 'The selected attachment does not exist anymore.',
@@ -70,8 +73,11 @@ $lang = array_merge($lang, array(
'MAKE_GLOBAL' => 'Change to “Global”',
'MAKE_NORMAL' => 'Change to “Standard Topic”',
'MAKE_STICKY' => 'Change to “Sticky”',
- 'MAX_OPTIONS_SELECT' => 'You may select up to <strong>%d</strong> options',
- 'MAX_OPTION_SELECT' => 'You may select <strong>1</strong> option',
+ 'MAX_OPTIONS_SELECT' => array(
+ 0 => 'You may select up to <strong>%d</strong> options',
+ 1 => 'You may select <strong>%d</strong> option',
+ 2 => 'You may select up to <strong>%d</strong> options',
+ ),
'MISSING_INLINE_ATTACHMENT' => 'The attachment <strong>%s</strong> is no longer available',
'MOVE_TOPIC' => 'Move topic',
@@ -105,8 +111,11 @@ $lang = array_merge($lang, array(
'VIEW_NEXT_TOPIC' => 'Next topic',
'VIEW_PREVIOUS_TOPIC' => 'Previous topic',
'VIEW_RESULTS' => 'View results',
- 'VIEW_TOPIC_POST' => '1 post',
- 'VIEW_TOPIC_POSTS' => '%d posts',
+ 'VIEW_TOPIC_POSTS' => array(
+ 0 => '%d posts',
+ 1 => '%d post',
+ 2 => '%d posts',
+ ),
'VIEW_UNREAD_POST' => 'First unread post',
'VISIT_WEBSITE' => 'WWW',
'VOTE_SUBMITTED' => 'Your vote has been cast.',
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php
index 8169ee7..a3f67f4 100644
--- a/phpBB/memberlist.php
+++ b/phpBB/memberlist.php
@@ -1587,7 +1587,7 @@ switch ($mode)
$template->assign_vars(array(
'PAGINATION' => generate_pagination($pagination_url, $total_users, $config['topics_per_page'], $start),
'PAGE_NUMBER' => on_page($total_users, $config['topics_per_page'], $start),
- 'TOTAL_USERS' => ($total_users == 1) ? $user->lang['LIST_USER'] : sprintf($user->lang['LIST_USERS'], $total_users),
+ 'TOTAL_USERS' => $user->lang('LIST_USERS', (int) $total_users),
'PROFILE_IMG' => $user->img('icon_user_profile', $user->lang['PROFILE']),
'PM_IMG' => $user->img('icon_contact_pm', $user->lang['SEND_PRIVATE_MESSAGE']),
diff --git a/phpBB/posting.php b/phpBB/posting.php
index 1bc498e..0e9be49 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -1193,8 +1193,8 @@ if (!sizeof($error) && $preview)
'POLL_QUESTION' => $parse_poll->message,
'L_POLL_LENGTH' => ($post_data['poll_length']) ? sprintf($user->lang['POLL_RUN_TILL'], $user->format_date($poll_end)) : '',
- 'L_MAX_VOTES' => ($post_data['poll_max_options'] == 1) ? $user->lang['MAX_OPTION_SELECT'] : sprintf($user->lang['MAX_OPTIONS_SELECT'], $post_data['poll_max_options']))
- );
+ 'L_MAX_VOTES' => $user->lang('MAX_OPTIONS_SELECT', (int) $post_data['poll_max_options']),
+ ));
$parse_poll->message = implode("\n", $post_data['poll_options']);
$parse_poll->format_display($post_data['enable_bbcode'], $post_data['enable_urls'], $post_data['enable_smilies']);
@@ -1469,7 +1469,7 @@ if (($mode == 'post' || ($mode == 'edit' && $post_id == $post_data['topic_first_
'S_POLL_DELETE' => ($mode == 'edit' && sizeof($post_data['poll_options']) && ((!$post_data['poll_last_vote'] && $post_data['poster_id'] == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id)) || $auth->acl_get('m_delete', $forum_id))),
'S_POLL_DELETE_CHECKED' => (!empty($poll_delete)) ? true : false,
- 'L_POLL_OPTIONS_EXPLAIN' => sprintf($user->lang['POLL_OPTIONS_' . (($mode == 'edit') ? 'EDIT_' : '') . 'EXPLAIN'], $config['max_poll_options']),
+ 'L_POLL_OPTIONS_EXPLAIN' => $user->lang('POLL_OPTIONS_' . (($mode == 'edit') ? 'EDIT_' : '') . 'EXPLAIN', (int) $config['max_poll_options']),
'VOTE_CHANGE_CHECKED' => (!empty($post_data['poll_vote_change'])) ? ' checked="checked"' : '',
'POLL_TITLE' => (isset($post_data['poll_title'])) ? $post_data['poll_title'] : '',
diff --git a/phpBB/search.php b/phpBB/search.php
index 2aa6140..eb4ac6c 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -136,7 +136,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
{
if ((strpos($author, '*') !== false) && (utf8_strlen(str_replace(array('*', '%'), '', $author)) < $config['min_search_author_chars']))
{
- trigger_error(sprintf($user->lang['TOO_FEW_AUTHOR_CHARS'], $config['min_search_author_chars']));
+ trigger_error($user->lang('TOO_FEW_AUTHOR_CHARS', (int) $config['min_search_author_chars']));
}
$sql_where = (strpos($author, '*') !== false) ? ' username_clean ' . $db->sql_like_expression(str_replace('*', $db->any_char, utf8_clean_string($author))) : " username_clean = '" . $db->sql_escape(utf8_clean_string($author)) . "'";
@@ -547,11 +547,11 @@ if ($keywords || $author || $author_id || $search_id || $submit)
{
// limit the number to 1000 for pre-made searches
$total_match_count--;
- $l_search_matches = sprintf($user->lang['FOUND_MORE_SEARCH_MATCHES'], $total_match_count);
+ $l_search_matches = $user->lang('FOUND_MORE_SEARCH_MATCHES', (int) $total_match_count);
}
else
{
- $l_search_matches = ($total_match_count == 1) ? sprintf($user->lang['FOUND_SEARCH_MATCH'], $total_match_count) : sprintf($user->lang['FOUND_SEARCH_MATCHES'], $total_match_count);
+ $l_search_matches = $user->lang('FOUND_SEARCH_MATCHES', (int) $total_match_count);
}
// define some vars for urls
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index e0b51bf..480f514 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -536,8 +536,8 @@ if ($s_display_active)
$template->assign_vars(array(
'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id" . ((strlen($u_sort_param)) ? "&amp;$u_sort_param" : '')), $topics_count, $config['topics_per_page'], $start),
'PAGE_NUMBER' => on_page($topics_count, $config['topics_per_page'], $start),
- 'TOTAL_TOPICS' => ($s_display_active) ? false : (($topics_count == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $topics_count)))
-);
+ 'TOTAL_TOPICS' => ($s_display_active) ? false : $user->lang('VIEW_FORUM_TOPICS', (int) $topics_count),
+));
$topic_list = ($store_reverse) ? array_merge($announcement_list, array_reverse($topic_list)) : array_merge($announcement_list, $topic_list);
$topic_tracking_info = $tracking_topics = array();
diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php
index 5eb2894..966402d 100644
--- a/phpBB/viewonline.php
+++ b/phpBB/viewonline.php
@@ -343,32 +343,6 @@ while ($row = $db->sql_fetchrow($result))
$db->sql_freeresult($result);
unset($prev_id, $prev_ip);
-// Generate reg/hidden/guest online text
-$vars_online = array(
- 'REG' => array('logged_visible_online', 'l_r_user_s'),
- 'HIDDEN'=> array('logged_hidden_online', 'l_h_user_s'),
- 'GUEST' => array('guest_counter', 'l_g_user_s')
-);
-
-foreach ($vars_online as $l_prefix => $var_ary)
-{
- switch ($$var_ary[0])
- {
- case 0:
- $$var_ary[1] = $user->lang[$l_prefix . '_USERS_ZERO_ONLINE'];
- break;
-
- case 1:
- $$var_ary[1] = $user->lang[$l_prefix . '_USER_ONLINE'];
- break;
-
- default:
- $$var_ary[1] = $user->lang[$l_prefix . '_USERS_ONLINE'];
- break;
- }
-}
-unset($vars_online);
-
$pagination = generate_pagination(append_sid("{$phpbb_root_path}viewonline.$phpEx", "sg=$show_guests&amp;sk=$sort_key&amp;sd=$sort_dir"), $counter, $config['topics_per_page'], $start);
// Grab group details for legend display
@@ -414,8 +388,8 @@ meta_refresh(60, append_sid("{$phpbb_root_path}viewonline.$phpEx", "sg=$show_gue
// Send data to template
$template->assign_vars(array(
- 'TOTAL_REGISTERED_USERS_ONLINE' => sprintf($l_r_user_s, $logged_visible_online) . sprintf($l_h_user_s, $logged_hidden_online),
- 'TOTAL_GUEST_USERS_ONLINE' => sprintf($l_g_user_s, $guest_counter),
+ 'TOTAL_REGISTERED_USERS_ONLINE' => $user->lang('REG_USERS_ONLINE', (int) $logged_visible_online, $user->lang('HIDDEN_USERS_ONLINE', (int) $logged_hidden_online)),
+ 'TOTAL_GUEST_USERS_ONLINE' => $user->lang('GUEST_USERS_ONLINE', (int) $guest_counter),
'LEGEND' => $legend,
'PAGINATION' => $pagination,
'PAGE_NUMBER' => on_page($counter, $config['topics_per_page'], $start),
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 203b858..ab8b22a 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -616,7 +616,7 @@ $template->assign_vars(array(
'PAGINATION' => $pagination,
'PAGE_NUMBER' => on_page($total_posts, $config['posts_per_page'], $start),
- 'TOTAL_POSTS' => ($total_posts == 1) ? $user->lang['VIEW_TOPIC_POST'] : sprintf($user->lang['VIEW_TOPIC_POSTS'], $total_posts),
+ 'TOTAL_POSTS' => $user->lang('VIEW_TOPIC_POSTS', (int) $total_posts),
'U_MCP' => ($auth->acl_get('m_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&amp;mode=topic_view&amp;f=$forum_id&amp;t=$topic_id" . (($start == 0) ? '' : "&amp;start=$start") . ((strlen($u_sort_param)) ? "&amp;$u_sort_param" : ''), true, $user->session_id) : '',
'MODERATORS' => (isset($forum_moderators[$forum_id]) && sizeof($forum_moderators[$forum_id])) ? implode(', ', $forum_moderators[$forum_id]) : '',
@@ -892,7 +892,7 @@ if (!empty($topic_data['poll_start']))
'POLL_LEFT_CAP_IMG' => $user->img('poll_left'),
'POLL_RIGHT_CAP_IMG'=> $user->img('poll_right'),
- 'L_MAX_VOTES' => ($topic_data['poll_max_options'] == 1) ? $user->lang['MAX_OPTION_SELECT'] : sprintf($user->lang['MAX_OPTIONS_SELECT'], $topic_data['poll_max_options']),
+ 'L_MAX_VOTES' => $user->lang('MAX_OPTIONS_SELECT', (int) $topic_data['poll_max_options']),
'L_POLL_LENGTH' => ($topic_data['poll_length']) ? sprintf($user->lang[($poll_end > time()) ? 'POLL_RUN_TILL' : 'POLL_ENDED_AT'], $user->format_date($poll_end)) : '',
'S_HAS_POLL' => true,
@@ -1419,8 +1419,6 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
unset($post_storage_list);
}
- $l_edit_time_total = ($row['post_edit_count'] == 1) ? $user->lang['EDITED_TIME_TOTAL'] : $user->lang['EDITED_TIMES_TOTAL'];
-
if ($row['post_edit_reason'])
{
// User having edited the post also being the post author?
@@ -1433,7 +1431,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
$display_username = get_username_string('full', $row['post_edit_user'], $post_edit_list[$row['post_edit_user']]['username'], $post_edit_list[$row['post_edit_user']]['user_colour']);
}
- $l_edited_by = sprintf($l_edit_time_total, $display_username, $user->format_date($row['post_edit_time'], false, true), $row['post_edit_count']);
+ $l_edited_by = $user->lang('EDITED_TIMES_TOTAL', (int) $row['post_edit_count'], $display_username, $user->format_date($row['post_edit_time'], false, true));
}
else
{
@@ -1452,7 +1450,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
$display_username = get_username_string('full', $row['post_edit_user'], $user_cache[$row['post_edit_user']]['username'], $user_cache[$row['post_edit_user']]['user_colour']);
}
- $l_edited_by = sprintf($l_edit_time_total, $display_username, $user->format_date($row['post_edit_time'], false, true), $row['post_edit_count']);
+ $l_edited_by = $user->lang('EDITED_TIMES_TOTAL', (int) $row['post_edit_count'], $display_username, $user->format_date($row['post_edit_time'], false, true));
}
}
else
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment