diff --git a/src/quant_platform_kit/common/notification_localization.py b/src/quant_platform_kit/common/notification_localization.py index 755f37c..3f34194 100644 --- a/src/quant_platform_kit/common/notification_localization.py +++ b/src/quant_platform_kit/common/notification_localization.py @@ -8,14 +8,8 @@ PRICE_SOURCE_LABELS: dict[str, tuple[str, str]] = { "longbridge_candlesticks": ("LongBridge 日线K线", "LongBridge daily candlesticks"), - "schwab_daily_history_with_live_quote_overlay": ( - "Schwab 日线历史 + 实时报价覆盖", - "Schwab daily history + live quote overlay", - ), - "firstrade_ohlc_with_live_quote_overlay": ( - "Firstrade OHLC + 实时报价覆盖", - "Firstrade OHLC + live quote overlay", - ), + "schwab_daily_history_with_live_quote_overlay": ("Schwab 日线历史", "Schwab daily history"), + "firstrade_ohlc_with_live_quote_overlay": ("Firstrade OHLC", "Firstrade OHLC"), "market_quote": ("实时行情报价", "market quote"), "mixed_market_quote_snapshot_close": ( "实时行情报价 + 快照收盘价回补", @@ -129,20 +123,6 @@ def localize_price_source_label( return source.replace("_", " ") -def localize_quote_overlay_state( - value: object, - *, - translator: NotificationTranslator | None = None, - locale: str | None = None, -) -> str: - use_zh = translator_uses_zh(translator) if translator is not None else locale_uses_zh(locale) - if value is True: - return "是" if use_zh else "yes" - if value is False: - return "否" if use_zh else "no" - return "未知" if use_zh else "unknown" - - def localize_notification_text( text: object, *, diff --git a/tests/test_notification_localization.py b/tests/test_notification_localization.py index 4cb5b7e..91e721d 100644 --- a/tests/test_notification_localization.py +++ b/tests/test_notification_localization.py @@ -5,7 +5,6 @@ from quant_platform_kit.common.notification_localization import ( COMMON_ZH_NOTIFICATION_REPLACEMENTS, localize_price_source_label, - localize_quote_overlay_state, localize_notification_text, translator_uses_zh, ) @@ -64,7 +63,7 @@ def test_localize_price_source_label_supports_broker_sources(self): "schwab_daily_history_with_live_quote_overlay", translator=_translator_factory("无需交易"), ), - "Schwab 日线历史 + 实时报价覆盖", + "Schwab 日线历史", ) self.assertEqual( localize_price_source_label( @@ -74,11 +73,6 @@ def test_localize_price_source_label_supports_broker_sources(self): "LongBridge daily candlesticks", ) - def test_localize_quote_overlay_state_supports_locale_without_translator(self): - self.assertEqual(localize_quote_overlay_state(True, locale="zh-CN"), "是") - self.assertEqual(localize_quote_overlay_state(False, locale="en-US"), "no") - self.assertEqual(localize_quote_overlay_state(None, locale="zh"), "未知") - if __name__ == "__main__": unittest.main()