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, Japanese and Korean, a to-do's owner no longer shows as 对方, 你 or 说话人2

wquguru75164ec08881
diff --git a/linux/cicada/app/notes_window.py b/linux/cicada/app/notes_window.py
index 0e2cc66..cf679b8 100644
--- a/linux/cicada/app/notes_window.py
+++ b/linux/cicada/app/notes_window.py
@@ -1069,7 +1069,7 @@ class NotesWindow(Gtk.Window):
for p in t.points:
body.pack_start(ui.gap(ui.text(p, 13, "body", width_chars=30), 4), False, False, 0)
for title, items in ((L("结论"), [c.text for c in n.conclusions]),
- (L("待办"), [t.text + (" · " + t.owner if t.owner else "") for t in n.todos])):
+ (L("待办"), [t.with_owner for t in n.todos])):
if not items:
continue
body.pack_start(ui.gap(ui.text(title, 11, "tertiary", bold=True), 16), False, False, 0)
diff --git a/linux/cicada/app/records_window.py b/linux/cicada/app/records_window.py
index 62d0ae1..f8784c4 100644
--- a/linux/cicada/app/records_window.py
+++ b/linux/cicada/app/records_window.py
@@ -1027,7 +1027,7 @@ class RecordsWindow(Gtk.Window):
cards = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=12)
cards.set_homogeneous(True)
for title, items in ((L("结论"), [c.text for c in n.conclusions]),
- (L("待办"), ["☐ " + t.text + (" · " + t.owner if t.owner else "") for t in n.todos])):
+ (L("待办"), ["☐ " + t.with_owner for t in n.todos])):
if not items:
continue
inner = ui.vbox(6, ui.text(title, 12, "tertiary", bold=True, wrap=False))
diff --git a/linux/cicada/core/models.py b/linux/cicada/core/models.py
index 2f8976e..0ca6432 100644
--- a/linux/cicada/core/models.py
+++ b/linux/cicada/core/models.py
@@ -131,6 +131,27 @@ class NoteItem:
def from_json(o: dict) -> "NoteItem":
return NoteItem(string(o.get("text")) or "", string(o.get("owner")), integer(o.get("support")) or 0, num(o.get("t")))
+ @property
+ def owner_shown(self) -> str | None:
+ """The owner as stored ("你", "对方", "说话人2" or a name) in the UI language (Notes.swift's ownerShown)."""
+ from .strings import L, LF
+ o = self.owner
+ if not o:
+ return None
+ if o in ("你", "对方", "未识别"):
+ return L(o)
+ n = o[3:].strip()
+ if o.startswith("说话人") and n.isdigit():
+ return LF("说话人 %lld", int(n))
+ return o
+
+ @property
+ def with_owner(self) -> str:
+ """The to-do with its owner after it: "(对方)" in Chinese, " (Them)" in English."""
+ from .strings import LF
+ shown = self.owner_shown
+ return self.text + (LF("待办的负责人 %@", shown) if shown else "")
+
@dataclass
class NoteTerm:
diff --git a/linux/cicada/core/session_store.py b/linux/cicada/core/session_store.py
index 1af0bf6..af7b41d 100644
--- a/linux/cicada/core/session_store.py
+++ b/linux/cicada/core/session_store.py
@@ -427,7 +427,7 @@ def notes_markdown(n) -> str:
if n.conclusions:
b.append("### %s\n\n" % L("结论") + "".join("- %s\n" % c.text for c in n.conclusions) + "\n")
if n.todos:
- b.append("### %s\n\n" % L("待办") + "".join("- [ ] %s%s\n" % (t.text, "(%s)" % t.owner if t.owner else "") for t in n.todos) + "\n")
+ b.append("### %s\n\n" % L("待办") + "".join("- [ ] %s\n" % t.with_owner for t in n.todos) + "\n")
if n.terms:
b.append("### %s\n\n" % L("人名和术语") + "".join("- **%s** %s\n" % (t.name, t.note) for t in n.terms) + "\n")
return "".join(b)
diff --git a/linux/tests/test_core.py b/linux/tests/test_core.py
index ee5bd59..4610755 100644
--- a/linux/tests/test_core.py
+++ b/linux/tests/test_core.py
@@ -859,6 +859,24 @@ class Strings(Base):
finally:
strings.load("zh-Hans", res)
+ def test_todo_owner_in_the_ui_language(self):
+ # The notes store the transcript's Chinese label; it shows in the UI language (Notes.swift's withOwner).
+ res = [os.path.join(REPO, "Resources"), os.path.join(REPO, "linux", "strings")]
+ todo = lambda owner: NoteItem(text="Ship it", owner=owner)
+ try:
+ strings.load("en", res)
+ self.assertEqual("Ship it (Them)", todo("对方").with_owner)
+ self.assertEqual("Ship it (You)", todo("你").with_owner)
+ self.assertEqual("Ship it (Speaker 2)", todo("说话人2").with_owner)
+ self.assertEqual("Ship it (Priya)", todo("Priya").with_owner)
+ self.assertEqual("Ship it", todo(None).with_owner)
+ self.assertEqual("Misheard words fixed: 1 · 2 to confirm", strings.LF("改了 %lld 处听错的词,%lld 处等你确认", 1, 2))
+ strings.load("zh-Hans", res)
+ self.assertEqual("Ship it(对方)", todo("对方").with_owner)
+ self.assertEqual("Ship it(说话人 2)", todo("说话人2").with_owner)
+ finally:
+ strings.load("zh-Hans", res)
+
def test_loads_the_macs_translations(self):
res = [os.path.join(REPO, "Resources"), os.path.join(REPO, "linux", "strings")]
strings.load("en_US.UTF-8", res)
diff --git a/site/changelog.json b/site/changelog.json
index f764960..4d3f9e6 100644
--- a/site/changelog.json
+++ b/site/changelog.json
@@ -157,6 +157,14 @@
],
"title": "Linux 上的纪要窗口又能用鼠标拖动了。",
"text": "之前点纪要窗口会在后台出错,按住拖不动窗口。现在点哪里都正常,拖到哪里就停在哪里。"
+ },
+ {
+ "kind": "fixed",
+ "platforms": [
+ "linux"
+ ],
+ "title": "Linux 的英文、日文、韩文界面里,待办后面的负责人不再显示成中文的“对方”“你”“说话人2”。",
+ "text": "纪要里记的是中文标记,显示时换成界面语言(Them、You、Speaker 2),导出的 Markdown 也一样。"
}
]
},