feat: countdowns and friend links locale

This commit is contained in:
Baoshuo Ren 2022-09-24 11:40:26 +08:00
parent 32859d67f3
commit 92cca91cce
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
3 changed files with 32 additions and 8 deletions

View File

@ -117,12 +117,14 @@
<div class="card card-default mt-4"> <div class="card card-default mt-4">
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?> <?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
<div class="card-header bg-white"> <div class="card-header bg-white">
<b>倒计时</b> <b><?= UOJLocale::get('countdowns') ?></b>
</div> </div>
<?php endif ?> <?php endif ?>
<div class="card-body"> <div class="card-body">
<?php if (!isset($REQUIRE_LIB['bootstrap5'])): ?> <?php if (!isset($REQUIRE_LIB['bootstrap5'])): ?>
<h4 class="card-title" style="font-size: 1.25rem">倒计时</h4> <h4 class="card-title" style="font-size: 1.25rem">
<?= UOJLocale::get('view all') ?>
</h4>
<?php endif ?> <?php endif ?>
<ul class=" <ul class="
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?> <?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
@ -138,27 +140,31 @@
?> ?>
<li> <li>
<?php if ($diff > 0): ?> <?php if ($diff > 0): ?>
距离 <b><?= $countdown['title'] ?></b> 还有 <b><?= $diff ?></b> 天。 <?= UOJLocale::get('x days until countdown title', $countdown['title'], $diff) ?>
<?php else: ?> <?php else: ?>
<b><?= $countdown['title'] ?></b> 已开始。 <?= UOJLocale::get("countdown title has begun", $countdown['title']) ?>
<?php endif ?> <?php endif ?>
</li> </li>
<?php endforeach ?> <?php endforeach ?>
</ul> </ul>
<?php if (count($countdowns) == 0): ?> <?php if (count($countdowns) == 0): ?>
<div class="text-center">(无)</div> <div class="text-center">
<?= UOJLocale::get('none') ?>
</div>
<?php endif ?> <?php endif ?>
</div> </div>
</div> </div>
<div class="card card-default mt-4"> <div class="card card-default mt-4">
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?> <?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
<div class="card-header bg-white"> <div class="card-header bg-white">
<b>友情链接</b> <b><?= UOJLocale::get('friend links') ?></b>
</div> </div>
<?php endif ?> <?php endif ?>
<div class="card-body"> <div class="card-body">
<?php if (!isset($REQUIRE_LIB['bootstrap5'])): ?> <?php if (!isset($REQUIRE_LIB['bootstrap5'])): ?>
<h4 class="card-title" style="font-size: 1.25rem">友情链接</h4> <h4 class="card-title" style="font-size: 1.25rem">
<?= UOJLocale::get('friend links') ?>
</h4>
<?php endif ?> <?php endif ?>
<ul class=" <ul class="
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?> <?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
@ -178,7 +184,9 @@
<?php endforeach ?> <?php endforeach ?>
</ul> </ul>
<?php if (count($friend_links) == 0): ?> <?php if (count($friend_links) == 0): ?>
<div class="text-center">(无)</div> <div class="text-center">
<?= UOJLocale::get('none') ?>
</div>
<?php endif ?> <?php endif ?>
</div> </div>
</div> </div>

View File

@ -75,6 +75,14 @@ return [
'refuse to answer' => 'Refuse to answer', 'refuse to answer' => 'Refuse to answer',
'male' => 'Male', 'male' => 'Male',
'female' => 'Female', 'female' => 'Female',
'countdowns' => 'Countdowns',
'countdown title has begun' => function($title) {
return "<b>$title</b> has begun.";
},
'x days until countdown title' => function($title, $days) {
return "<b>$days</b> ".($days <= 1 ? 'day' : 'days')." until <b>$title</b>.";
},
'friend links' => 'Friend Links',
'server time' => 'Server Time', 'server time' => 'Server Time',
'opensource project' => 'OpenSource Project, modified by S2OJ' 'opensource project' => 'OpenSource Project, modified by S2OJ'
]; ];

View File

@ -75,6 +75,14 @@ return [
'refuse to answer' => '拒绝回答', 'refuse to answer' => '拒绝回答',
'male' => '男', 'male' => '男',
'female' => '女', 'female' => '女',
'countdowns' => '倒计时',
'countdown title has begun' => function($title) {
return "<b>$title</b> 已开始。";
},
'x days until countdown title' => function($title, $days) {
return "距离 <b>$title</b> 还有 <b>$days</b>天。";
},
'friend links' => '友情链接',
'server time' => '服务器时间', 'server time' => '服务器时间',
'opensource project' => '开源项目S2OJ 魔改版' 'opensource project' => '开源项目S2OJ 魔改版'
]; ];