diff --git a/notifications/telegram.py b/notifications/telegram.py index 3ee7308..e3b5a10 100644 --- a/notifications/telegram.py +++ b/notifications/telegram.py @@ -77,8 +77,8 @@ "blend_gate_reason_bollinger_cap": "突破布林上轨", "blend_gate_reason_volatility_delever": "{symbol} {window} 日年化波动率 {volatility} 高于 {threshold},SOXL 转向 {redirect_symbol}", "strategy_plugin_line": "🧩 插件:{plugin} | 状态:{route} | 提醒:{action}", - "strategy_plugin_alert_subject": "🚨 危机插件告警:{plugin} | {route}", - "strategy_plugin_alert_title": "🚨 【危机插件告警】", + "strategy_plugin_alert_subject": "🚨 策略插件告警:{plugin} | {route}", + "strategy_plugin_alert_title": "🚨 【策略插件告警】", "strategy_plugin_alert_context": "运行环境:{context}", "strategy_plugin_alert_strategy": "策略:{strategy}", "strategy_plugin_alert_plugin": "插件:{plugin}", @@ -87,12 +87,15 @@ "strategy_plugin_alert_mode": "模式:{mode}", "strategy_plugin_alert_as_of": "信号时间:{as_of}", "strategy_plugin_name_crisis_response_shadow": "危机观察通知", + "strategy_plugin_name_taco_rebound_shadow": "TACO 抄底观察通知", "strategy_plugin_mode_shadow": "影子观察", - "strategy_plugin_route_no_action": "未触发危机", + "strategy_plugin_route_no_action": "未触发", "strategy_plugin_route_true_crisis": "真危机", + "strategy_plugin_route_taco_rebound": "TACO 反弹确认", "strategy_plugin_route_unknown_route": "未知状态", "strategy_plugin_action_no_action": "不操作", "strategy_plugin_action_watch_only": "仅通知", + "strategy_plugin_action_notify_manual_review": "通知人工复核", "strategy_plugin_action_defend": "防守", "strategy_plugin_action_blocked": "已阻断", "strategy_plugin_action_monitor": "持续观察", @@ -201,8 +204,8 @@ "blend_gate_reason_bollinger_cap": "price above upper band", "blend_gate_reason_volatility_delever": "{symbol} {window}d annualized volatility {volatility} is above {threshold}; redirect SOXL to {redirect_symbol}", "strategy_plugin_line": "🧩 Plugin: {plugin} | status: {route} | notice: {action}", - "strategy_plugin_alert_subject": "🚨 Crisis plugin alert: {plugin} | {route}", - "strategy_plugin_alert_title": "🚨 【Crisis Plugin Alert】", + "strategy_plugin_alert_subject": "🚨 Strategy plugin alert: {plugin} | {route}", + "strategy_plugin_alert_title": "🚨 【Strategy Plugin Alert】", "strategy_plugin_alert_context": "Context: {context}", "strategy_plugin_alert_strategy": "Strategy: {strategy}", "strategy_plugin_alert_plugin": "Plugin: {plugin}", @@ -211,12 +214,15 @@ "strategy_plugin_alert_mode": "Mode: {mode}", "strategy_plugin_alert_as_of": "Signal as-of: {as_of}", "strategy_plugin_name_crisis_response_shadow": "Crisis Watch Notice", + "strategy_plugin_name_taco_rebound_shadow": "TACO Rebound Watch Notice", "strategy_plugin_mode_shadow": "shadow", - "strategy_plugin_route_no_action": "no crisis detected", + "strategy_plugin_route_no_action": "no alert", "strategy_plugin_route_true_crisis": "true crisis", + "strategy_plugin_route_taco_rebound": "TACO rebound confirmed", "strategy_plugin_route_unknown_route": "unknown status", "strategy_plugin_action_no_action": "no action", "strategy_plugin_action_watch_only": "notify only", + "strategy_plugin_action_notify_manual_review": "notify manual review", "strategy_plugin_action_defend": "defend", "strategy_plugin_action_blocked": "blocked", "strategy_plugin_action_monitor": "watch", diff --git a/tests/test_notifications.py b/tests/test_notifications.py index 44f10af..c5ca4f8 100644 --- a/tests/test_notifications.py +++ b/tests/test_notifications.py @@ -44,7 +44,17 @@ def test_build_translator_supports_chinese(): route=translate("strategy_plugin_route_no_action"), action=translate("strategy_plugin_action_watch_only"), ) - == "🧩 插件:危机观察通知 | 状态:未触发危机 | 提醒:仅通知" + == "🧩 插件:危机观察通知 | 状态:未触发 | 提醒:仅通知" + ) + assert ( + translate( + "strategy_plugin_line", + plugin=translate("strategy_plugin_name_taco_rebound_shadow"), + mode=translate("strategy_plugin_mode_shadow"), + route=translate("strategy_plugin_route_taco_rebound"), + action=translate("strategy_plugin_action_notify_manual_review"), + ) + == "🧩 插件:TACO 抄底观察通知 | 状态:TACO 反弹确认 | 提醒:通知人工复核" ) assert translate("account_ids_detail", account_ids="U18308207") == "🆔 账户: U18308207" assert (