Skip to content

Commit 72847e0

Browse files
committed
feat(i18n): order channel list by UI language
1 parent 3c19614 commit 72847e0

1 file changed

Lines changed: 36 additions & 14 deletions

File tree

channel/web/web_channel.py

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,22 +1046,44 @@ def startup(self):
10461046

10471047
self._cleanup_stale_voice_recordings()
10481048

1049-
# Print available channel types
1049+
# Print available channel types (ordered by language: prioritize
1050+
# locally-popular channels for the current UI language)
10501051
logger.info(
10511052
"[WebChannel] Available channels (edit `channel_type` in config.json to switch, separate multiple with commas):")
1052-
logger.info("[WebChannel] 1. web - Web")
1053-
logger.info("[WebChannel] 2. terminal - Terminal")
1054-
logger.info("[WebChannel] 3. weixin - WeChat")
1055-
logger.info("[WebChannel] 4. feishu - Feishu")
1056-
logger.info("[WebChannel] 5. dingtalk - DingTalk")
1057-
logger.info("[WebChannel] 6. wecom_bot - WeCom Bot")
1058-
logger.info("[WebChannel] 7. wechatcom_app - WeCom App")
1059-
logger.info("[WebChannel] 8. wechat_kf - WeChat Customer Service")
1060-
logger.info("[WebChannel] 9. wechatmp - WeChat Official Account")
1061-
logger.info("[WebChannel] 10. wechatmp_service - WeChat Official Account (Service)")
1062-
logger.info("[WebChannel] 11. telegram - Telegram")
1063-
logger.info("[WebChannel] 12. slack - Slack")
1064-
logger.info("[WebChannel] 13. discord - Discord")
1053+
zh_channels = [
1054+
("web", "Web"),
1055+
("terminal", "Terminal"),
1056+
("weixin", "WeChat"),
1057+
("feishu", "Feishu"),
1058+
("dingtalk", "DingTalk"),
1059+
("wecom_bot", "WeCom Bot"),
1060+
("wechatcom_app", "WeCom App"),
1061+
("wechat_kf", "WeChat Customer Service"),
1062+
("wechatmp", "WeChat Official Account"),
1063+
("wechatmp_service", "WeChat Official Account (Service)"),
1064+
("telegram", "Telegram"),
1065+
("slack", "Slack"),
1066+
("discord", "Discord"),
1067+
]
1068+
en_channels = [
1069+
("web", "Web"),
1070+
("terminal", "Terminal"),
1071+
("telegram", "Telegram"),
1072+
("slack", "Slack"),
1073+
("discord", "Discord"),
1074+
("weixin", "WeChat"),
1075+
("feishu", "Feishu"),
1076+
("dingtalk", "DingTalk"),
1077+
("wecom_bot", "WeCom Bot"),
1078+
("wechatcom_app", "WeCom App"),
1079+
("wechat_kf", "WeChat Customer Service"),
1080+
("wechatmp", "WeChat Official Account"),
1081+
("wechatmp_service", "WeChat Official Account (Service)"),
1082+
]
1083+
channels = en_channels if i18n.get_language() == "en" else zh_channels
1084+
name_width = max(len(name) for name, _ in channels)
1085+
for idx, (name, label) in enumerate(channels, 1):
1086+
logger.info(f"[WebChannel] {idx:>2}. {name:<{name_width}} - {label}")
10651087
logger.info("[WebChannel] ✅ Web console is running")
10661088
logger.info(f"[WebChannel] 🌐 Local access: http://localhost:{port}")
10671089
if is_public_bind:

0 commit comments

Comments
 (0)