|
4 | 4 |
|
5 | 5 | from notifications.events import NotificationPublisher, RenderedNotification |
6 | 6 |
|
| 7 | +try: |
| 8 | + from quant_platform_kit.common.notification_localization import ( |
| 9 | + merge_strategy_plugin_i18n as _merge_strategy_plugin_i18n, |
| 10 | + ) |
| 11 | +except ImportError: # pragma: no cover - compatibility with older pinned shared wheels |
| 12 | + _merge_strategy_plugin_i18n = None |
| 13 | + |
7 | 14 |
|
8 | 15 | SIGNAL_ICONS = { |
9 | 16 | "hold": "💎", |
|
131 | 138 | "strategy_plugin_name_macro_risk_governor": "宏观风险控制通知", |
132 | 139 | "strategy_plugin_name_market_regime_control": "市场状态控制通知", |
133 | 140 | "strategy_plugin_name_panic_reversal_shadow": "恐慌反转观察通知", |
134 | | - "strategy_plugin_name_taco_rebound_shadow": "TACO 抄底观察通知", |
| 141 | + "strategy_plugin_name_taco_rebound_shadow": "TACO 反弹观察通知", |
135 | 142 | "strategy_plugin_mode_shadow": "影子观察", |
136 | 143 | "strategy_plugin_route_blocked": "已阻断", |
137 | 144 | "strategy_plugin_route_crisis": "危机", |
|
313 | 320 | }, |
314 | 321 | } |
315 | 322 |
|
| 323 | +if _merge_strategy_plugin_i18n is not None: |
| 324 | + I18N = _merge_strategy_plugin_i18n(I18N) |
| 325 | + |
316 | 326 |
|
317 | 327 | def build_translator(lang): |
318 | 328 | def translate(key, **kwargs): |
@@ -370,7 +380,7 @@ def send_tg_message(message): |
370 | 380 | prefixed = with_prefix_fn(message) |
371 | 381 | requests_module.post(url, json={"chat_id": chat_id, "text": prefixed}, timeout=10) |
372 | 382 | except Exception as exc: |
373 | | - print(f"Telegram send failed: {exc}", flush=True) |
| 383 | + print(f"Telegram send failed: {type(exc).__name__}", flush=True) |
374 | 384 |
|
375 | 385 | return send_tg_message |
376 | 386 |
|
|
0 commit comments