1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-08 01:36:57 +02:00

[ticket/10345] Make use of the plural function in some basic places

PHPBB3-10345
This commit is contained in:
Joas Schilling
2011-09-14 00:28:52 +02:00
committed by Oleg Pudeyev
parent 0734dd3c42
commit 88ae40a4b1
37 changed files with 283 additions and 272 deletions

View File

@@ -132,7 +132,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

View File

@@ -119,22 +119,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)
);
}
}
}
@@ -220,20 +207,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),
));
}
}
@@ -313,20 +290,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

View File

@@ -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'],

View File

@@ -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']),

View File

@@ -311,7 +311,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),
)
);

View File

@@ -436,7 +436,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';

View File

@@ -425,7 +425,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),
)
);

View File

@@ -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),
));
}

View File

@@ -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),
));
}