Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

改进文章时间的翻译 #423

Merged
merged 1 commit into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,24 +189,23 @@ function pk_get_post_date()
$c_time = time() - $time;
$day = 86400;
switch ($c_time) {
//todo 本地化翻译
case $c_time < $day:
$res = '近一天内';
$res = __('近一天内',PUOCK);
break;
case $c_time < ($day * 2):
$res = '近两天内';
$res = __('近两天内',PUOCK);
break;
case $c_time < ($day * 3):
$res = '近三天内';
$res = __('近三天内',PUOCK);
break;
case $c_time < ($day * 4):
$res = '四天前';
$res = __('四天前',PUOCK);
break;
case $c_time < ($day * 5):
$res = '五天前';
$res = __('五天前',PUOCK);
break;
case $c_time < ($day * 6):
$res = '六天前';
$res = __('六天前',PUOCK);
break;
default:
$res = date('Y-m-d', $time);
Expand Down
Binary file modified languages/en_US.mo
Binary file not shown.
20 changes: 19 additions & 1 deletion languages/en_US.po
Original file line number Diff line number Diff line change
Expand Up @@ -1424,4 +1424,22 @@ msgid "评论数"
msgstr "Comments"

msgid "个评论"
msgstr " Comments"
msgstr " Comments"

msgid "近一天内"
msgstr "In the last day"

msgid "近两天内"
msgstr "In the last two days"

msgid "近三天内"
msgstr "In the last three days"

msgid "四天前"
msgstr "4 days ago"

msgid "五天前"
msgstr "5 days ago"

msgid "六天前"
msgstr "6 days ago"