Skip to content

知了 Cicada · 任何会议和直播的实时字幕、同声传译、AI 会议纪要,Mac、Windows、Linux、Android 免费开源。Live subtitles, interpreting and meeting notes for any call or stream, on Mac, Windows, Linux and Android.

fix(linux): in English, a server error from your own AI server names it Other (OpenAI-compatible) instead of in Chinese

wqugurue9618cd95861
diff --git a/linux/cicada/core/listen.py b/linux/cicada/core/listen.py
index 790c58f..9b11865 100644
--- a/linux/cicada/core/listen.py
+++ b/linux/cicada/core/listen.py
@@ -585,6 +585,7 @@ def problem(e: LingError, service: str, hear_model: str = ""):
设置 fixes it, in the words of the settings' 听对方 step. A 5xx is the service's own trouble."""
L, LF = strings.L, strings.LF
ling = service == "Ling"
+ service = service if ling else L(service) # 其他(兼容 OpenAI) is UI text; brand names stay as they are
if e.kind == LingError.HTTP and e.status in (400, 404, 415, 422) and not ling:
return "key", LF("%@ 听不了声音。", hear_model or service)
# It answered, with an error: like busy, it passes by itself (AICheck's serverError words).
diff --git a/linux/tests/test_providers.py b/linux/tests/test_providers.py
index 509d164..a0fa714 100644
--- a/linux/tests/test_providers.py
+++ b/linux/tests/test_providers.py
@@ -266,6 +266,15 @@ class Words(Base):
# A gateway's 502 in front of the server: the service's trouble, not the network or the key.
self.assertEqual(("busy", "ZenMux 暂时出错(HTTP 502),稍后再试。"), problem(LingError(LingError.HTTP, 502), "ZenMux"))
self.assertEqual(("busy", "Ling 暂时出错(HTTP 503),稍后再试。"), problem(LingError(LingError.HTTP, 503), "Ling"))
+ # 其他(兼容 OpenAI) is UI text: in English it reads as the settings name it.
+ from cicada.core import strings
+ res = [os.path.join(os.path.dirname(__file__), "..", "..", "Resources")]
+ strings.load("en", res)
+ try:
+ self.assertEqual("Other (OpenAI-compatible) has a temporary error (HTTP 502). Try again shortly.",
+ problem(LingError(LingError.HTTP, 502), "其他(兼容 OpenAI)")[1])
+ finally:
+ strings.load("zh-Hans", res)
def test_final_notes_keep_retrying_for_about_a_minute(self):
from cicada.core.ling import NOTES, retry_waits