diff --git a/LOCALES.md b/LOCALES.md index e8385917..05f63baf 100644 --- a/LOCALES.md +++ b/LOCALES.md @@ -119,19 +119,19 @@ 中文弯引号和英文弯引号属于同一个字符,如果使用弯引号反而会造成阅读问题,请使用直引号 `"`。 正确: -> +> "Success is not final, failure is not fatal: It is the courage to continue that counts." 错误: -> +> “Success is not final, failure is not fatal: It is the courage to continue that counts.” ### 英文省略号使用三个点 同上,请使用三个点 `...`。 正确: -> +> In the serene moonlit night, whispers of ancient tales lingered, echoing through the stillness of time... 错误: -> +> In the serene moonlit night, whispers of ancient tales lingered, echoing through the stillness of time… ## 全角和半角 ### 使用全角中文标点 @@ -143,8 +143,6 @@ > > 嗨!你知道嘛?今天前台的小妹跟我说"喵"了哎! -例外:如果括号内为没有中文且难以多语言化,则可以使用半角括号。 - ### 数字和英文使用半角字符 正确: > 这件蛋糕只卖 1000 元。 diff --git a/core/builtins/message/__init__.py b/core/builtins/message/__init__.py index 1af47ce5..879841bf 100644 --- a/core/builtins/message/__init__.py +++ b/core/builtins/message/__init__.py @@ -158,9 +158,9 @@ class MessageSession(MessageSessionT): ftime_template.append(self.locale.t("time.time.nosec.format")) if timezone: if self._tz_offset == "+0": - ftime_template.append(f"(UTC)") + ftime_template.append(self.locale.t("message.brackets", msg="UTC")) else: - ftime_template.append(f"(UTC{self._tz_offset})") + ftime_template.append(self.locale.t("message.brackets", msg=f"UTC{self._tz_offset}")) return (datetime.utcfromtimestamp(timestamp) + self.timezone_offset).strftime(' '.join(ftime_template)) diff --git a/locales/en_us.json b/locales/en_us.json index e06179b5..9168c7c3 100644 --- a/locales/en_us.json +++ b/locales/en_us.json @@ -35,6 +35,7 @@ "game.message.stop.none": "This game is not in progress.", "i18n.prompt.fallback.failed": "(If you're seeing this strange string, it means something we've messed up!\nPlease send the issue back to\n${url}\nso that we can fix it in time.)", "language": "English", + "message.brackets": " (${msg})", "message.collapse": "...show only the first ${amount} items.", "message.cooldown": "${time} second(s) have passed since the last execution. The cooldown time of this command are ${cd_time} second(s).", "message.delimiter": ", ", diff --git a/locales/zh_cn.json b/locales/zh_cn.json index e670193c..97e83da2 100644 --- a/locales/zh_cn.json +++ b/locales/zh_cn.json @@ -35,13 +35,14 @@ "game.message.stop.none": "当前此游戏未在进行。", "i18n.prompt.fallback.failed": "(如果你看到了这条奇怪的字符串,说明我们又搞错了什么东西!\n请将问题反馈至\n${url}\n以便我们快速解决此问题。)", "language": "简体中文", + "message.brackets": "(${msg})", + "message.collapse": "……仅显示前 ${amount} 条内容。", "message.cooldown": "距离上次执行已过去 ${time} 秒,本命令的冷却时间为 ${cd_time} 秒。", "message.delimiter": "、", "message.end": "。", "message.reply.prompt": "(请使用指定的词语回复本条消息)", "message.wait.confirm.prompt.type1": "(发送“是”或符合确认条件的词语来确认)", "message.wait.confirm.prompt.type2": "(发送符合条件的词语来确认)", - "message.collapse": "……仅显示前 ${amount} 条内容。", "no": "否", "none": "无", "parser.admin.module.permission.denied": "“${module}”模块下的命令仅能被该群组的管理员所使用,请联系管理员执行此命令。", @@ -59,8 +60,8 @@ "petal.message.lost.limit": "(本日失去花瓣已达到每日上限。)", "petal.message.lost.success": "失去了 ${amount} 片花瓣。", "success": "成功。", - "time.date.iso.format": "%Y-%m-%d", "time.date.format": "%Y 年 %m 月 %d 日", + "time.date.iso.format": "%Y-%m-%d", "time.time.format": "%H:%M:%S", "time.time.nosec.format": "%H:%M", "tos.reason": "具体原因:", @@ -75,4 +76,4 @@ "tos.warning.last": "这是最后一次警告。", "unknown": "未知", "yes": "是" -} +} \ No newline at end of file diff --git a/locales/zh_tw.json b/locales/zh_tw.json index ebeac250..7e5950cf 100644 --- a/locales/zh_tw.json +++ b/locales/zh_tw.json @@ -35,6 +35,7 @@ "game.message.stop.none": "目前此遊戲沒有在進行。", "i18n.prompt.fallback.failed": "(如果你看到了這條奇怪的字串,說明我們又搞錯了什麼!\n請將問題回報至\n${url}\n以便我們快速解決此問題。)", "language": "繁體中文", + "message.brackets": "(${msg})", "message.collapse": "……僅顯示前 ${amount} 條內容。", "message.cooldown": "距上次執行已過去 ${time} 秒,此指令的冷卻時間為 ${cd_time} 秒。", "message.delimiter": "、", diff --git a/modules/bilibili/bilibili.py b/modules/bilibili/bilibili.py index 7f1ba443..0d68d6fb 100644 --- a/modules/bilibili/bilibili.py +++ b/modules/bilibili/bilibili.py @@ -22,7 +22,7 @@ async def get_info(msg: Bot.MessageSession, url, get_detail): time = msg.ts2strftime(view['ctime'], timezone=False) if len(view['pages']) > 1: - pages = f" ({len(view['pages'])}P)" + pages = msg.locale.t("message.brackets", msg=f"{len(view['pages'])}P") else: pages = ''