From c04998c99f03b6827ff353ac7e94a695d6095eaf Mon Sep 17 00:00:00 2001 From: StableAgOH Date: Mon, 13 Jun 2022 01:04:37 +0800 Subject: [PATCH] perf: enhance message --- src/index.ts | 9 ++++++--- src/locale/en.json | 6 +++--- src/locale/zh-CN.json | 6 +++--- src/locale/zh-NE.json | 6 +++--- src/locale/zh-TW.json | 6 +++--- 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/index.ts b/src/index.ts index db30b6f..db2c8d0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -103,7 +103,7 @@ export default class Lscontests })); info.push(...msg(running)); } - else info.push(lang.norunning); + else info.push(_.template(lang.norunning)({ oj: this.config.abbrList.map(abbr => alloj[abbr].name) })); } if(this.config.upcoming) @@ -118,7 +118,7 @@ export default class Lscontests })); info.push(...msg(upcoming)); } - else info.push(lang.noupcoming_all); + else info.push(_.template(lang.noupcoming_all)({ oj: this.config.abbrList.map(abbr => alloj[abbr].name) })); } else { @@ -131,7 +131,10 @@ export default class Lscontests })); info.push(...msg(upcoming)); } - else info.push(_.template(lang.noupcoming)({ days: this.config.days })); + else info.push(_.template(lang.noupcoming)({ + oj: this.config.abbrList.map(abbr => alloj[abbr].name), + days: this.config.days + })); } } return pangu.spacing(info.join("\n\n")); diff --git a/src/locale/en.json b/src/locale/en.json index c48febb..298b5c7 100644 --- a/src/locale/en.json +++ b/src/locale/en.json @@ -1,10 +1,10 @@ { "runnning": "There are ${contestCount} contests is running on ${oj}", - "norunning": "No running contests", + "norunning": "There are no running contests on ${oj}", "upcoming": "There are ${contestCount} contests on ${oj} in the next ${days} days", "upcoming_all": "There will be ${contestCount} contests on ${oj} in the future", - "noupcoming": "No contests for the next ${days} days", - "noupcoming_all": "There is no contests in the future???", + "noupcoming": "No contests on ${oj} for the next ${days} days", + "noupcoming_all": "There are no future contests on ${oj}", "ojName": "OJ", "name": "Contest name", "rule": "Rule", diff --git a/src/locale/zh-CN.json b/src/locale/zh-CN.json index be08e71..bea606f 100644 --- a/src/locale/zh-CN.json +++ b/src/locale/zh-CN.json @@ -1,10 +1,10 @@ { "runnning": "在 ${oj} 上有 ${contestCount} 场正在进行的比赛", - "norunning": "没有正在进行的比赛捏", + "norunning": "在 ${oj} 上没有正在进行的比赛捏", "upcoming": "接下来的 ${days} 天内在 ${oj} 上有 ${contestCount} 场比赛", "upcoming_all": "将来在 ${oj} 上有 ${contestCount} 场比赛", - "noupcoming": "接下来的 ${days} 天内没有比赛捏", - "noupcoming_all": "将来竟然没有比赛???", + "noupcoming": "接下来的 ${days} 天内在 ${oj} 上没有比赛捏", + "noupcoming_all": "将来在 ${oj} 上没有比赛", "ojName": "比赛平台", "name": "比赛名称", "rule": "赛制", diff --git a/src/locale/zh-NE.json b/src/locale/zh-NE.json index 5cb8220..8d0bd4c 100644 --- a/src/locale/zh-NE.json +++ b/src/locale/zh-NE.json @@ -1,10 +1,10 @@ { "runnning": "搁 ${oj} 上有 ${contestCount} 场比赛正偷摸干着呢", - "norunning": "这前属实是没比赛打", + "norunning": "这前搁 ${oj} 上属实是没比赛打", "upcoming": "之后 ${days} 天搁 ${oj} 上拢共 ${contestCount} 场比赛", "upcoming_all": "往后搁 ${oj} 上有 ${contestCount} 场比赛", - "noupcoming": "没成想往后 ${days} 天没比赛打啊", - "noupcoming_all": "啥玩意?之后没比赛???", + "noupcoming": "没成想往后 ${days} 天搁 ${oj} 上没比赛打啊", + "noupcoming_all": "将来搁 ${oj} 上没比赛", "ojName": "搁哪", "name": "叫啥", "rule": "咋个整法", diff --git a/src/locale/zh-TW.json b/src/locale/zh-TW.json index 02dad29..5c02365 100644 --- a/src/locale/zh-TW.json +++ b/src/locale/zh-TW.json @@ -1,10 +1,10 @@ { "runnning": "在 ${oj} 上有 ${contestCount} 場正在進行的比賽", - "norunning": "沒有正在進行的比賽", + "norunning": "在 ${oj} 上沒有正在進行的比賽", "upcoming": "接下来的 ${days} 天內在 ${oj} 上有 ${contestCount} 場比賽", "upcoming_all": "將來在 ${oj} 上有 ${contestCount} 場比賽", - "noupcoming": "接下來的 ${days} 天內沒有比賽", - "noupcoming_all": "將來竟然沒有比賽? ? ?", + "noupcoming": "接下來的 ${days} 天內在 ${oj} 上沒有比賽", + "noupcoming_all": "將來在 ${oj} 上沒有比賽", "ojName": "比賽平台", "name": "比賽名稱", "rule": "賽制",