Skip to content

Commit

Permalink
perf: enhance message
Browse files Browse the repository at this point in the history
  • Loading branch information
StableAgOH committed Jun 12, 2022
1 parent 7d5bf27 commit c04998c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
9 changes: 6 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
{
Expand All @@ -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"));
Expand Down
6 changes: 3 additions & 3 deletions src/locale/en.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
6 changes: 3 additions & 3 deletions src/locale/zh-CN.json
Original file line number Diff line number Diff line change
@@ -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": "赛制",
Expand Down
6 changes: 3 additions & 3 deletions src/locale/zh-NE.json
Original file line number Diff line number Diff line change
@@ -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": "咋个整法",
Expand Down
6 changes: 3 additions & 3 deletions src/locale/zh-TW.json
Original file line number Diff line number Diff line change
@@ -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": "賽制",
Expand Down

0 comments on commit c04998c

Please sign in to comment.