Skip to content

Commit 0ae8f46

Browse files
authored
Merge pull request #516 from QuantStrategyLab/fix/operational-alert-i18n-coverage
fix: localize no-enabled-target heartbeat
2 parents ff106aa + fa35dfd commit 0ae8f46

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/quant_platform_kit/common/operational_notification_localization.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"heartbeat_missing_acceptable_report": "缺少可接受的执行回执:{targets}",
4040
"heartbeat_no_acceptable_report": "最近 {count} 份执行回执均不符合要求",
4141
"heartbeat_runtime_target_disabled": "运行目标已停用;未提交订单。",
42+
"heartbeat_no_enabled_target": "没有与当前心跳匹配的可执行运行目标;未提交订单。",
4243
"heartbeat_no_scheduled_window_due": "当前没有应执行的交易窗口;未提交订单。",
4344
"heartbeat_no_scheduler_run_due": "当前没有应执行的调度任务;未提交订单。",
4445
"heartbeat_accepted_report": "已收到合格执行回执:{detail}",
@@ -73,6 +74,7 @@
7374
"heartbeat_missing_acceptable_report": "Missing acceptable execution report: {targets}",
7475
"heartbeat_no_acceptable_report": "None of the most recent {count} execution reports was acceptable",
7576
"heartbeat_runtime_target_disabled": "Runtime target is disabled; no order was submitted.",
77+
"heartbeat_no_enabled_target": "No enabled runtime target matches this heartbeat; no order was submitted.",
7678
"heartbeat_no_scheduled_window_due": "No scheduled trading window was due; no order was submitted.",
7779
"heartbeat_no_scheduler_run_due": "No scheduler-backed run was due; no order was submitted.",
7880
"heartbeat_accepted_report": "An acceptable execution report was received: {detail}",

tests/test_notification_localization.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@ def test_operational_locale_and_normal_heartbeat_are_bilingual(self):
144144
self.assertEqual(resolve_operational_notification_locale("zh_TW"), "zh")
145145
self.assertEqual(resolve_operational_notification_locale("fr"), "en")
146146
self.assertEqual(localize_operational_activity("zh", "no trade"), "无交易")
147+
self.assertEqual(
148+
operational_notification_text("zh", "heartbeat_no_enabled_target"),
149+
"没有与当前心跳匹配的可执行运行目标;未提交订单。",
150+
)
147151
self.assertEqual(
148152
format_operational_heartbeat_status(
149153
locale="zh",

0 commit comments

Comments
 (0)