mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-08 14:18:40 +00:00
chore: update translation
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
2fb8f10084
commit
0298f95726
@ -8,7 +8,7 @@ $time_form = new UOJForm('time');
|
||||
$time_form->addInput(
|
||||
'name',
|
||||
[
|
||||
'label' => '比赛标题',
|
||||
'label' => UOJLocale::get('contests::contest name'),
|
||||
'default_value' => 'New Contest',
|
||||
'validator_php' => function ($name, &$vdata) {
|
||||
if ($name == '') {
|
||||
@ -35,8 +35,8 @@ $time_form->addInput(
|
||||
'start_time',
|
||||
[
|
||||
'div_class' => 'mt-2',
|
||||
'label' => '开始时间',
|
||||
'default_value' => date("Y-m-d H:i:s"),
|
||||
'label' => UOJLocale::get('contests::start time'),
|
||||
'default_value' => UOJTime::$time_now_str,
|
||||
'validator_php' => function ($str, &$vdata) {
|
||||
try {
|
||||
$vdata['start_time'] = new DateTime($str);
|
||||
@ -52,8 +52,9 @@ $time_form->addInput(
|
||||
'last_min',
|
||||
[
|
||||
'div_class' => 'mt-2',
|
||||
'label' => '时长(单位:分钟)',
|
||||
'label' => UOJLocale::get('contests::duration'),
|
||||
'default_value' => '180',
|
||||
'help' => '单位为分钟。',
|
||||
'validator_php' => function ($str, &$vdata) {
|
||||
if (!validateUInt($str)) {
|
||||
return '必须为一个整数';
|
||||
|
@ -66,33 +66,33 @@ if (UOJContest::cur()) {
|
||||
$tabs_info = [
|
||||
'dashboard' => [
|
||||
'name' => UOJLocale::get('contests::contest dashboard'),
|
||||
'url' => '/contest/' . UOJContest::info('id'),
|
||||
'url' => UOJContest::cur()->getUri(),
|
||||
],
|
||||
'submissions' => [
|
||||
'name' => UOJLocale::get('contests::contest submissions'),
|
||||
'url' => '/contest/' . UOJContest::info('id') . '/submissions',
|
||||
'url' => UOJContest::cur()->getUri('/submissions'),
|
||||
],
|
||||
'standings' => [
|
||||
'name' => UOJLocale::get('contests::contest standings'),
|
||||
'url' => '/contest/' . UOJContest::info('id') . '/standings',
|
||||
'url' => UOJContest::cur()->getUri('/standings'),
|
||||
],
|
||||
];
|
||||
|
||||
if (UOJContest::cur()->progress() > CONTEST_TESTING) {
|
||||
$tabs_info['after_contest_standings'] = [
|
||||
'name' => UOJLocale::get('contests::after contest standings'),
|
||||
'url' => '/contest/' . UOJContest::info('id') . '/after_contest_standings',
|
||||
'url' => UOJContest::cur()->getUri('/after_contest_standings'),
|
||||
];
|
||||
$tabs_info['self_reviews'] = [
|
||||
'name' => UOJLocale::get('contests::contest self reviews'),
|
||||
'url' => '/contest/' . UOJContest::info('id') . '/self_reviews',
|
||||
'url' => UOJContest::cur()->getUri('/self_reviews'),
|
||||
];
|
||||
}
|
||||
|
||||
if (UOJContest::cur()->userCanManage(Auth::user())) {
|
||||
$tabs_info['backstage'] = [
|
||||
'name' => UOJLocale::get('contests::contest backstage'),
|
||||
'url' => '/contest/' . UOJContest::info('id') . '/backstage',
|
||||
'url' => UOJContest::cur()->getUri('/backstage'),
|
||||
];
|
||||
}
|
||||
}
|
||||
@ -200,7 +200,7 @@ if ($custom_test_enabled) {
|
||||
}
|
||||
|
||||
if (empty($submission_requirement)) {
|
||||
$no_more_submission = '当前题目未配置提交文件,请联系管理员!';
|
||||
$no_more_submission = UOJLocale::get('problems::cannot submit');
|
||||
}
|
||||
|
||||
if ($pre_submit_check_ret === true && !$no_more_submission) {
|
||||
@ -220,7 +220,7 @@ if ($pre_submit_check_ret === true && !$no_more_submission) {
|
||||
'handleUpload'
|
||||
);
|
||||
$zip_answer_form->extra_validators[] = $submission_extra_validator;
|
||||
$zip_answer_form->succ_href = $is_participating ? '/contest/' . UOJContest::info('id') . '/submissions' : '/submissions';
|
||||
$zip_answer_form->succ_href = $is_participating ? UOJContest::cur()->getUri('/submissions') : '/submissions';
|
||||
$zip_answer_form->runAtServer();
|
||||
}
|
||||
|
||||
@ -257,7 +257,7 @@ if ($pre_submit_check_ret === true && !$no_more_submission) {
|
||||
}
|
||||
|
||||
$answer_form->extra_validator = $submission_extra_validator;
|
||||
$answer_form->succ_href = $is_participating ? '/contest/' . UOJContest::info('id') . '/submissions' : '/submissions';
|
||||
$answer_form->succ_href = $is_participating ? UOJContest::cur()->getUri('/submissions') : '/submissions';
|
||||
$answer_form->runAtServer();
|
||||
}
|
||||
|
||||
@ -302,9 +302,9 @@ if (UOJContest::cur()) {
|
||||
}
|
||||
?>
|
||||
<div class="text-center small">
|
||||
时间限制: <?= $time_limit ? "$time_limit s" : "N/A" ?>
|
||||
<?= UOJLocale::get('problems::time limit') ?>: <?= $time_limit ? "$time_limit s" : "N/A" ?>
|
||||
 
|
||||
空间限制: <?= $memory_limit ? "$memory_limit MB" : "N/A" ?>
|
||||
<?= UOJLocale::get('problems::memory limit') ?>: <?= $memory_limit ? "$memory_limit MB" : "N/A" ?>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
@ -319,7 +319,7 @@ if (UOJContest::cur()) {
|
||||
<hr>
|
||||
|
||||
<article class="mt-3 markdown-body remote-content">
|
||||
<?= UOJProblem::cur()->queryContent()['remote_content'] ?>
|
||||
<?= $problem_content['remote_content'] ?>
|
||||
</article>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
@ -370,8 +370,15 @@ if (UOJContest::cur()) {
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer bg-transparent">
|
||||
比赛评价:<?= UOJContest::cur()->getZanBlock() ?>
|
||||
<div class="list-group list-group-flush">
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
<span class="flex-shrink-0">
|
||||
<?= UOJLocale::get('appraisal') ?>
|
||||
</span>
|
||||
<span>
|
||||
<?= UOJContest::cur()->getZanBlock() ?>
|
||||
</span>
|
||||
</li>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (UOJContest::cur()->progress() <= CONTEST_IN_PROGRESS) : ?>
|
||||
@ -406,7 +413,7 @@ if (UOJContest::cur()) {
|
||||
<?php endif ?>
|
||||
<?php if (!UOJContest::cur() || UOJContest::cur()->progress() >= CONTEST_FINISHED) : ?>
|
||||
<li class="nav-item text-start">
|
||||
<a href="/problem/<?= $problem['id'] ?>/solutions" class="nav-link" role="tab">
|
||||
<a href="<?= UOJProblem::cur()->getUri('/solution') ?>" class="nav-link">
|
||||
<i class="bi bi-journal-bookmark"></i>
|
||||
<?= UOJLocale::get('problems::solutions') ?>
|
||||
</a>
|
||||
@ -420,14 +427,14 @@ if (UOJContest::cur()) {
|
||||
</li>
|
||||
<?php if (UOJContest::cur() && UOJContest::cur()->userCanSeeProblemStatistics(Auth::user())) : ?>
|
||||
<li class="nav-item text-start">
|
||||
<a class="nav-link" href="/contest/<?= UOJContest::info('id') ?>/problem/<?= $problem['id'] ?>/statistics">
|
||||
<a class="nav-link" href="<?= UOJContestProblem::cur()->getUri('/statistics') ?>">
|
||||
<i class="bi bi-graph-up"></i>
|
||||
<?= UOJLocale::get('problems::statistics') ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php elseif (!UOJContest::cur()) : ?>
|
||||
<li class="nav-item text-start">
|
||||
<a class="nav-link" href="/problem/<?= $problem['id'] ?>/statistics">
|
||||
<a class="nav-link" href="<?= UOJProblem::cur()->getUri('/statistics') ?>">
|
||||
<i class="bi bi-graph-up"></i>
|
||||
<?= UOJLocale::get('problems::statistics') ?>
|
||||
</a>
|
||||
@ -435,7 +442,7 @@ if (UOJContest::cur()) {
|
||||
<?php endif ?>
|
||||
<?php if (UOJProblem::cur()->userCanManage(Auth::user())) : ?>
|
||||
<li class="nav-item text-start">
|
||||
<a class="nav-link" href="/problem/<?= $problem['id'] ?>/manage/statement" role="tab">
|
||||
<a class="nav-link" href="<?= UOJProblem::cur()->getUri('/manage/statement') ?>">
|
||||
<i class="bi bi-sliders"></i>
|
||||
<?= UOJLocale::get('problems::manage') ?>
|
||||
</a>
|
||||
@ -457,7 +464,7 @@ if (UOJContest::cur()) {
|
||||
</li>
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
<span class="flex-shrink-0">
|
||||
题目来源
|
||||
<?= UOJLocale::get('problems::problem source') ?>
|
||||
</span>
|
||||
<span>
|
||||
<?= UOJProblem::cur()->getProviderLink() ?>
|
||||
@ -520,21 +527,23 @@ if (UOJContest::cur()) {
|
||||
|
||||
<!-- 附件 -->
|
||||
<div class="card mb-2">
|
||||
<div class="card-header fw-bold">附件</div>
|
||||
<div class="card-header fw-bold">
|
||||
<?= UOJLocale::get('problems::attachments') ?>
|
||||
</div>
|
||||
<div class="list-group list-group-flush">
|
||||
<?php if (UOJProblem::cur()->userCanDownloadTestData(Auth::user())) : ?>
|
||||
<a class="list-group-item list-group-item-action" href="<?= HTML::url(UOJProblem::cur()->getMainDataUri()) ?>">
|
||||
<i class="bi bi-hdd-stack"></i>
|
||||
测试数据
|
||||
<?= UOJLocale::get('problems::test data') ?>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
<a class="list-group-item list-group-item-action" href="<?= HTML::url(UOJProblem::cur()->getAttachmentUri()) ?>">
|
||||
<i class="bi bi-download"></i>
|
||||
附件下载
|
||||
<?= UOJLocale::get('problems::attachments download') ?>
|
||||
</a>
|
||||
<a class="list-group-item list-group-item-action" href="<?= HTML::url(UOJProblem::cur()->getResourcesBaseUri()) ?>">
|
||||
<i class="bi bi-folder2-open"></i>
|
||||
相关资源
|
||||
<?= UOJLocale::get('problems::resources') ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -67,33 +67,33 @@ $submissions_sort_by_choice = !isset($_COOKIE['submissions-sort-by-code-length']
|
||||
$tabs_info = [
|
||||
'dashboard' => [
|
||||
'name' => UOJLocale::get('contests::contest dashboard'),
|
||||
'url' => '/contest/' . UOJContest::info('id'),
|
||||
'url' => UOJContest::cur()->getUri(),
|
||||
],
|
||||
'submissions' => [
|
||||
'name' => UOJLocale::get('contests::contest submissions'),
|
||||
'url' => '/contest/' . UOJContest::info('id') . '/submissions',
|
||||
'url' => UOJContest::cur()->getUri('/submissions'),
|
||||
],
|
||||
'standings' => [
|
||||
'name' => UOJLocale::get('contests::contest standings'),
|
||||
'url' => '/contest/' . UOJContest::info('id') . '/standings',
|
||||
'url' => UOJContest::cur()->getUri('/standings'),
|
||||
],
|
||||
];
|
||||
|
||||
if (UOJContest::cur()->progress() > CONTEST_TESTING) {
|
||||
$tabs_info['after_contest_standings'] = [
|
||||
'name' => UOJLocale::get('contests::after contest standings'),
|
||||
'url' => '/contest/' . UOJContest::info('id') . '/after_contest_standings',
|
||||
'url' => UOJContest::cur()->getUri('/after_contest_standings'),
|
||||
];
|
||||
$tabs_info['self_reviews'] = [
|
||||
'name' => UOJLocale::get('contests::contest self reviews'),
|
||||
'url' => '/contest/' . UOJContest::info('id') . '/self_reviews',
|
||||
'url' => UOJContest::cur()->getUri('/self_reviews'),
|
||||
];
|
||||
}
|
||||
|
||||
if (UOJContest::cur()->userCanManage(Auth::user())) {
|
||||
$tabs_info['backstage'] = [
|
||||
'name' => UOJLocale::get('contests::contest backstage'),
|
||||
'url' => '/contest/' . UOJContest::info('id') . '/backstage',
|
||||
'url' => UOJContest::cur()->getUri('/backstage'),
|
||||
];
|
||||
}
|
||||
?>
|
||||
@ -104,7 +104,6 @@ $submissions_sort_by_choice = !isset($_COOKIE['submissions-sort-by-code-length']
|
||||
|
||||
<div class="card card-default mb-2">
|
||||
<div class="card-body">
|
||||
|
||||
<h1 class="text-center">
|
||||
<?php if (UOJContest::cur()) : ?>
|
||||
<?= UOJProblem::cur()->getTitle(['with' => 'letter', 'simplify' => true]) ?>
|
||||
@ -115,7 +114,9 @@ $submissions_sort_by_choice = !isset($_COOKIE['submissions-sort-by-code-length']
|
||||
|
||||
<hr />
|
||||
|
||||
<h2 class="text-center"><?= UOJLocale::get('problems::accepted submissions') ?></h2>
|
||||
<h2 class="text-center">
|
||||
<?= UOJLocale::get('problems::accepted submissions') ?>
|
||||
</h2>
|
||||
<div class="text-end mb-2">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a href="<?= UOJContext::requestURI() ?>" class="btn btn-secondary btn-xs <?= $submissions_sort_by_choice == 'time' ? 'active' : '' ?>" id="submissions-sort-by-run-time">
|
||||
@ -265,8 +266,15 @@ $submissions_sort_by_choice = !isset($_COOKIE['submissions-sort-by-code-length']
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer bg-transparent">
|
||||
比赛评价:<?= UOJContest::cur()->getZanBlock() ?>
|
||||
<div class="list-group list-group-flush">
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
<span class="flex-shrink-0">
|
||||
<?= UOJLocale::get('appraisal') ?>
|
||||
</span>
|
||||
<span>
|
||||
<?= UOJContest::cur()->getZanBlock() ?>
|
||||
</span>
|
||||
</li>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (UOJContest::cur()->progress() <= CONTEST_IN_PROGRESS) : ?>
|
||||
|
@ -16,7 +16,6 @@ return [
|
||||
'groups' => 'Groups',
|
||||
'add new group' => 'Add new group',
|
||||
'group announcement' => 'Group Announcement',
|
||||
'group announcements' => 'Group Announcements',
|
||||
'users count' => 'Users',
|
||||
'submissions' => 'Submissions',
|
||||
'hacks' => 'Hack!',
|
||||
|
@ -16,7 +16,6 @@ return [
|
||||
'groups' => '小组',
|
||||
'add new group' => '添加新小组',
|
||||
'group announcement' => '小组公告',
|
||||
'group announcements' => '小组公告',
|
||||
'users count' => '用户数量',
|
||||
'submissions' => '提交记录',
|
||||
'hacks' => 'Hack!',
|
||||
|
@ -2,6 +2,7 @@
|
||||
return [
|
||||
'new contest' => 'New Contest',
|
||||
'current or upcoming contests' => 'Current or upcoming contests',
|
||||
'upcoming contests' => 'Upcoming contests',
|
||||
'ended contests' => 'Ended contests',
|
||||
'back to the contest' => 'Back to the contest',
|
||||
'contest' => 'Contest',
|
||||
|
@ -2,6 +2,7 @@
|
||||
return [
|
||||
'new contest' => '新建比赛',
|
||||
'current or upcoming contests' => '正在进行或即将到来的比赛',
|
||||
'upcoming contests' => '即将到来的比赛',
|
||||
'ended contests' => '已结束的比赛',
|
||||
'back to the contest' => '返回比赛',
|
||||
'contest' => '比赛',
|
||||
|
@ -22,6 +22,7 @@ return [
|
||||
'solutions' => 'Solutions',
|
||||
'statistics' => 'Statistics',
|
||||
'run' => 'Run',
|
||||
'problem source' => 'Problem Source',
|
||||
'source code' => 'Source code',
|
||||
'text file' => 'Text file',
|
||||
'zip file upload introduction' => function($str) {
|
||||
@ -56,4 +57,11 @@ return [
|
||||
'tags' => 'Tags',
|
||||
'historical score' => 'Historical Score',
|
||||
'uploader' => 'Uploader',
|
||||
'time limit' => 'Time limit',
|
||||
'memory limit' => 'Memory limit',
|
||||
'attachments' => 'Attachments',
|
||||
'test data' => 'Test data',
|
||||
'attachments download' => 'Attachments download',
|
||||
'resources' => 'Resources',
|
||||
'cannot submit' => 'This problem doesn\'t configured <code>submission_requirement</code>, so it cannot be submitted temporarily.',
|
||||
];
|
||||
|
@ -21,10 +21,11 @@ return [
|
||||
'submissions statistics' => '统计提交情况',
|
||||
'statistics' => '统计',
|
||||
'solutions' => '题解',
|
||||
'problem source' => '题目来源',
|
||||
'run' => '运行',
|
||||
'source code' => '源代码',
|
||||
'text file' => '文本文件',
|
||||
'zip file upload introduction' => function($str) {
|
||||
'zip file upload introduction' => function ($str) {
|
||||
return "请上传你要提交的文件,并命名为 {$str}。如果你提交了 zip 压缩包,我们会为你自动解压。";
|
||||
},
|
||||
'or upload files one by one' => '或者逐个上传:',
|
||||
@ -56,4 +57,11 @@ return [
|
||||
'tags' => '标签',
|
||||
'historical score' => '历史分数',
|
||||
'uploader' => '上传者',
|
||||
'time limit' => '时间限制',
|
||||
'memory limit' => '内存限制',
|
||||
'attachments' => '附件',
|
||||
'test data' => '测试数据',
|
||||
'attachments download' => '附件下载',
|
||||
'resources' => '相关资源',
|
||||
'cannot submit' => '当前题目未配置 <code>submission_requirement</code>,暂时无法提交。'
|
||||
];
|
||||
|
@ -115,7 +115,7 @@ class UOJGroup {
|
||||
DB::lc(), "select list_id from groups_assignments",
|
||||
"where", [
|
||||
"group_id" => $this->info['id'],
|
||||
["end_time", ">=", DB::raw("addtime(now(), '-72:00:00')")],
|
||||
["end_time", ">=", DB::now()],
|
||||
],
|
||||
"order by end_time desc, list_id asc",
|
||||
$limit == -1 ? "" : DB::limit($limit),
|
||||
|
@ -8,8 +8,8 @@ $parsedown = HTML::parsedown(['username_with_color' => true]);
|
||||
<?php $groups = UOJGroup::queryGroupsOfUser(Auth::user()); ?>
|
||||
<?php if (!empty($groups)) : ?>
|
||||
<div class="card card-default mb-2" id="group-user-announcements">
|
||||
<div class="card-header fw-bold bg-transparent">
|
||||
<?= UOJLocale::get('group announcements') ?>
|
||||
<div class="card-header fw-bold">
|
||||
<?= UOJLocale::get('groups') ?>
|
||||
</div>
|
||||
<ul class="list-group list-group-flush">
|
||||
<?php foreach ($groups as $group) : ?>
|
||||
@ -36,12 +36,11 @@ $parsedown = HTML::parsedown(['username_with_color' => true]);
|
||||
$assignments = array_merge($assignments, array_map(fn ($x) => UOJGroupAssignment::query($x, $group), $group->getActiveAssignmentIds()));
|
||||
}
|
||||
|
||||
usort($assignments, fn ($a, $b) => $b->info['end_time']->getTimestamp() - $a->info['end_time']->getTimestamp());
|
||||
$assignments = array_slice($assignments, 0, 5);
|
||||
usort($assignments, fn ($a, $b) => $a->info['end_time']->getTimestamp() - $b->info['end_time']->getTimestamp());
|
||||
?>
|
||||
<?php if (!empty($assignments)) : ?>
|
||||
<div class="card card-default mb-2" id="group-assignments">
|
||||
<div class="card-header fw-bold bg-transparent">
|
||||
<div class="card-header fw-bold">
|
||||
<?= UOJLocale::get('assignments') ?>
|
||||
</div>
|
||||
<ul class="list-group list-group-flush">
|
||||
@ -65,8 +64,8 @@ $parsedown = HTML::parsedown(['username_with_color' => true]);
|
||||
<?php if (!isset($upcoming_contests_hidden)) : ?>
|
||||
<?php $upcoming_contests = UOJContest::queryUpcomingContests(Auth::user(), 5); ?>
|
||||
<div class="card card-default mb-2" id="group-user-announcements">
|
||||
<div class="card-header fw-bold bg-transparent">
|
||||
近期比赛
|
||||
<div class="card-header fw-bold">
|
||||
<?= UOJLocale::get('contests::upcoming contests') ?>
|
||||
</div>
|
||||
<ul class="list-group list-group-flush">
|
||||
<?php foreach ($upcoming_contests as $contest) : ?>
|
||||
|
Loading…
Reference in New Issue
Block a user