From 941073f07c7fa053310f0832a42d0ecaa1cabc7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9A=E7=BE=85=E7=8B=BC?= Date: Sat, 21 Oct 2023 15:09:45 +0800 Subject: [PATCH] optimization locale (#995) --- locales/zh_cn.json | 1 + locales/zh_tw.json | 1 + modules/ask/__init__.py | 2 +- modules/ask/locales/en_us.json | 1 - modules/ask/locales/zh_cn.json | 1 - modules/ask/locales/zh_tw.json | 1 - modules/coin/__init__.py | 2 +- modules/coin/locales/zh_cn.json | 3 +-- 8 files changed, 5 insertions(+), 7 deletions(-) diff --git a/locales/zh_cn.json b/locales/zh_cn.json index db6c3980..b195e40f 100644 --- a/locales/zh_cn.json +++ b/locales/zh_cn.json @@ -28,6 +28,7 @@ "failed": "失败。", "i18n.prompt.fallback.failed": "(如果你看到了这条奇怪的字符串,说明我们又搞错了什么东西!\n请将问题反馈至\n${url}\n以便我们快速解决此问题。)", "language": "简体中文", + "message.cooldown": "距离上次执行已过去 ${time} 秒,本命令的冷却时间为 ${cd_time} 秒。", "message.delimiter": "、", "message.end": "。", "message.reply.prompt": "(请使用指定的词语回复本条消息)", diff --git a/locales/zh_tw.json b/locales/zh_tw.json index c57ab143..cb12618b 100644 --- a/locales/zh_tw.json +++ b/locales/zh_tw.json @@ -28,6 +28,7 @@ "failed": "失敗。", "i18n.prompt.fallback.failed": "(如果你看到了這條奇怪的字串,說明我們又搞錯了什麼!\n請將問題回報至\n${url}\n以便我們快速解決此問題。)", "language": "繁體中文", + "message.cooldown": "距上次執行已過去 ${time} 秒,此指令的冷卻時間為 ${cd_time} 秒。", "message.delimiter": "、", "message.end": "。", "message.reply.prompt": "(請使用指定的詞語回覆此訊息)", diff --git a/modules/ask/__init__.py b/modules/ask/__init__.py index 3f97638e..597089f4 100644 --- a/modules/ask/__init__.py +++ b/modules/ask/__init__.py @@ -88,7 +88,7 @@ async def _(msg: Bot.MessageSession): if msg.target.target_from != 'TEST|Console' and not is_superuser: qc.reset() else: - await msg.finish(msg.locale.t('ask.message.cooldown', time=int(c))) + await msg.finish(msg.locale.t('message.cooldown', time=int(c), cd_time='60')) def parse_markdown(md: str): diff --git a/modules/ask/locales/en_us.json b/modules/ask/locales/en_us.json index 340d31e0..a41296f7 100644 --- a/modules/ask/locales/en_us.json +++ b/modules/ask/locales/en_us.json @@ -2,6 +2,5 @@ "ask.help": "Answer your question via ChatGPT.", "ask.help.regex": "Question:? Answer your question via ChatGPT.", "ask.help.desc": "Ask AkariBot anything!", - "ask.message.cooldown": "距离上次执行已过去 ${time} 秒,本命令的冷却时间为 60 秒。", "ask.message.text2img.error": "(An error occurred: Unable to correctly convert the following content into images. Here is the original text output:\n${text}) " } diff --git a/modules/ask/locales/zh_cn.json b/modules/ask/locales/zh_cn.json index bd0eb5a2..0261aee5 100644 --- a/modules/ask/locales/zh_cn.json +++ b/modules/ask/locales/zh_cn.json @@ -2,6 +2,5 @@ "ask.help": "通过 ChatGPT 回答问题。", "ask.help.regex": "问:? 通过 ChatGPT 回答问题。", "ask.help.desc": "有事为什么不问问小可呢?", - "ask.message.cooldown": "距离上次执行已过去 ${time} 秒,本命令的冷却时间为 60 秒。", "ask.message.text2img.error": "(发生错误:无法正确将以下内容转换为图片,尝试原文输出:\n${text})" } diff --git a/modules/ask/locales/zh_tw.json b/modules/ask/locales/zh_tw.json index ca2f7f20..da3679cc 100644 --- a/modules/ask/locales/zh_tw.json +++ b/modules/ask/locales/zh_tw.json @@ -2,6 +2,5 @@ "ask.help": "透過 ChatGPT 回答問題。", "ask.help.regex": "問:? 透過 ChatGPT 回答問題。", "ask.help.desc": "有問題為什麽不問小可呢?", - "ask.message.cooldown": "距上次執行已過去 ${time} 秒,此指令的冷卻時間為 60 秒。", "ask.message.text2img.error": "(發生錯誤:無法正確將以下內容轉換為圖片,嘗試原文輸出:\n${text})" } diff --git a/modules/coin/__init__.py b/modules/coin/__init__.py index d8f40cc8..8f749736 100644 --- a/modules/coin/__init__.py +++ b/modules/coin/__init__.py @@ -103,6 +103,6 @@ async def _(msg: Bot.MessageSession): qc = CoolDown('stone', msg) c = qc.check(30) if c != 0: - await msg.finish(msg.locale.t('stone.message.cooldown', time=int(c))) + await msg.finish(msg.locale.t('message.cooldown', time=int(c), cd_time='30')) qc.reset() await skip_stone(msg) diff --git a/modules/coin/locales/zh_cn.json b/modules/coin/locales/zh_cn.json index dad2e0df..b5925fd5 100644 --- a/modules/coin/locales/zh_cn.json +++ b/modules/coin/locales/zh_cn.json @@ -18,6 +18,5 @@ "coin.message.stand": "…\n…它立起来了!", "coin.message.tail": "…\n…是反面!", "stone.help.desc": "打水漂。", - "stone.message.skip": "你扔了一块石头,漂了${count}下。", - "stone.message.cooldown": "距离上次执行已过去 ${time} 秒,本命令的冷却时间为 30 秒。" + "stone.message.skip": "你扔了一块石头,漂了 ${count} 下。" }