perf: 优化翻译

This commit is contained in:
kuaifan 2024-09-23 01:34:06 +03:00
parent dcd41b4be2
commit 0ab6e6ca8d
5 changed files with 1198 additions and 1164 deletions

View File

@ -12,6 +12,7 @@ use App\Models\FileLink;
use App\Models\FileUser;
use App\Models\User;
use App\Module\Base;
use App\Module\Doo;
use App\Module\Ihttp;
use Response;
use Session;
@ -1089,13 +1090,13 @@ class FileController extends AbstractController
]);
}
//
$text = "<b>文件下载打包已完成。</b>";
$text = "<b>" . Doo::translate("文件下载打包已完成。") . "</b>";
$text .= "\n\n";
$text .= "文件名:{$fileName}";
$text .= Doo::translate("文件名") . ": {$fileName}";
$text .= "\n";
$text .= "文件大小:".Base::twoFloat(filesize($zipPath) / 1024, true)."KB";
$text .= Doo::translate("文件大小") . ": ".Base::twoFloat(filesize($zipPath) / 1024, true)."KB";
$text .= "\n";
$text .= '<a href="' . $fileUrl . '" target="_blank"><button type="button" class="ivu-btn ivu-btn-warning" style="margin-top: 10px;"><span>立即下载</span></button></a>';
$text .= '<a href="' . $fileUrl . '" target="_blank"><button type="button" class="ivu-btn ivu-btn-warning" style="margin-top: 10px;"><span>' . Doo::translate("立即下载") . '</span></button></a>';
WebSocketDialogMsg::sendMsg(null, $dialog->id, 'text', ['text' => $text], $botUser->userid, false, false, true);
});
return Base::retSuccess('success', [

View File

@ -253,7 +253,7 @@ class UserBot extends AbstractModel
$typeDesc = $type == "up" ? "上班" : "下班";
if (Cache::get($cacheKey) === "yes") {
if ($alreadyTip && $dialog = WebSocketDialog::checkUserDialog($botUser, $checkin['userid'])) {
$text = "<p>今日已{$typeDesc}打卡,无需重复打卡。</p>";
$text = "<p>" . Doo::translate("今日已{$typeDesc}打卡,无需重复打卡。") . "</p>";
WebSocketDialogMsg::sendMsg(null, $dialog->id, 'text', ['text' => $text], $botUser->userid, false, false, $type != "up");
}
return;
@ -263,7 +263,7 @@ class UserBot extends AbstractModel
if ($dialog = WebSocketDialog::checkUserDialog($botUser, $checkin['userid'])) {
$hi = date("H:i");
$remark = $checkin['remark'] ? " ({$checkin['remark']})": "";
$text = "<p>{$typeDesc}打卡成功,打卡时间: {$hi}{$remark}</p>";
$text = "<p>{$typeDesc}" . Doo::translate("打卡成功,打卡时间") . ": {$hi}{$remark}</p>";
$suff = $getJokeSoup($type);
if ($suff) {
$text = "{$text}<p>----------</p><p>{$suff}</p>";

View File

@ -7,6 +7,7 @@ use App\Models\UserCheckinRecord;
use App\Models\WebSocketDialog;
use App\Models\WebSocketDialogMsg;
use App\Module\Base;
use App\Module\Doo;
use App\Module\Extranet;
use Cache;
use Carbon\Carbon;
@ -83,9 +84,9 @@ class CheckinRemindTask extends AbstractTask
$dialog = WebSocketDialog::checkUserDialog($botUser, $user->userid);
if ($dialog) {
if ($type === 'exceed') {
$text = "<p><strong style='color:red'>缺卡提醒:</strong>上班时间到了,你还没有打卡哦~</p>";
$text = "<p><strong style='color:red'>" . Doo::translate("缺卡提醒") . "</strong>" . Doo::translate("上班时间到了,你还没有打卡哦~") . "</p>";
} else {
$text = "<p><strong>打卡提醒:</strong>快到上班时间了,别忘了打卡哦~</p>";
$text = "<p><strong>" . Doo::translate("打卡提醒") . "</strong>" . Doo::translate("快到上班时间了,别忘了打卡哦~") . "</p>";
}
WebSocketDialogMsg::sendMsg(null, $dialog->id, 'text', ['text' => $text], $botUser->userid);
}

View File

@ -508,3 +508,26 @@ Api接口文档
视频
创建签到机器人失败
文件下载打包已完成。
文件名
文件大小
立即下载
系统消息
任务提醒
签到打卡
审批
文心一言
通义千问
智谱清言
机器人管理
会议通知
OKR提醒
今日已上班打卡,无需重复打卡。
今日已下班打卡,无需重复打卡。
打卡成功,打卡时间
缺卡提醒
打卡提醒
上班时间到了,你还没有打卡哦~
快到上班时间了,别忘了打卡哦~

File diff suppressed because it is too large Load Diff