知了 Cicada · 任何会议和直播的实时字幕、同声传译、AI 会议纪要,Mac、Windows、Linux、Android 免费开源。Live subtitles, interpreting and meeting notes for any call or stream, on Mac, Windows, Linux and Android.
Swift androidlinuxlive-captionsmacosmeeting-notesmenubar-appsimultaneous-interpretationspeech-recognitionsubtitlesswiftswiftuitranslationwindows
fix(windows): in English, Japanese and Korean, a to-do's owner no longer shows as 对方, 你 or 说话人2
wqugurud5fbff2957f1
diff --git a/site/changelog.json b/site/changelog.jsonindex d8e1e38..3030ac0 100644--- a/site/changelog.json+++ b/site/changelog.json@@ -189,6 +189,14 @@],"title": "Linux 的英文、日文、韩文界面里,待办后面的负责人不再显示成中文的“对方”“你”“说话人2”。","text": "纪要里记的是中文标记,显示时换成界面语言(Them、You、Speaker 2),导出的 Markdown 也一样。"+ },+ {+ "kind": "fixed",+ "platforms": [+ "windows"+ ],+ "title": "Windows 上的英文、日文、韩文界面里,待办后面的负责人不再显示成中文的“对方”“你”“说话人2”。",+ "text": "纪要里记的是中文标记,显示时换成界面语言(Them、You、Speaker 2),导出的 Markdown 也一样。"}]},diff --git a/windows/src/Cicada.Core/Models.cs b/windows/src/Cicada.Core/Models.csindex cd55051..4c773c3 100644--- a/windows/src/Cicada.Core/Models.cs+++ b/windows/src/Cicada.Core/Models.cs@@ -139,6 +139,20 @@ public sealed class NoteItem/// When it was said (first evidence line).[JsonPropertyName("t")] public double? T { get; set; }[JsonPropertyName("text")] public string Text { get; set; } = "";++ /// The owner as stored ("你", "对方", "说话人2" or a name) in the UI language.+ [JsonIgnore]+ public string? OwnerShown => Owner switch+ {+ null or "" => null,+ "你" or "对方" or "未识别" => Strings.L(Owner),+ _ when Owner.StartsWith("说话人", StringComparison.Ordinal) && int.TryParse(Owner[3..].Trim(), out var n) => Strings.LF("说话人 %lld", n),+ _ => Owner,+ };++ /// The to-do with its owner after it: "(对方)" in Chinese, " (Them)" in English.+ [JsonIgnore]+ public string WithOwner => Text + (OwnerShown is { } o ? Strings.LF("待办的负责人 %@", o) : "");}/// A name or term as the notes settled on it, and how speech recognition heard it.diff --git a/windows/src/Cicada.Core/SessionStore.cs b/windows/src/Cicada.Core/SessionStore.csindex b0f49b4..d9714d2 100644--- a/windows/src/Cicada.Core/SessionStore.cs+++ b/windows/src/Cicada.Core/SessionStore.cs@@ -296,7 +296,7 @@ public sealed class SessionStoreif (n.Todos.Count > 0){b.AppendLine($"### {Strings.L("待办")}").AppendLine();- foreach (var t in n.Todos) b.AppendLine($"- [ ] {t.Text}{(t.Owner is null ? "" : $"({t.Owner})")}");+ foreach (var t in n.Todos) b.AppendLine($"- [ ] {t.WithOwner}");b.AppendLine();}return b.ToString();diff --git a/windows/src/Cicada/MainWindow.cs b/windows/src/Cicada/MainWindow.csindex 55e782c..407de80 100644--- a/windows/src/Cicada/MainWindow.cs+++ b/windows/src/Cicada/MainWindow.cs@@ -565,7 +565,7 @@ sealed class MainWindow : WindowDockPanel.SetDock(at, Dock.Right);row.Children.Add(at);}- row.Children.Add(Ui.Text(item.Text + (item.Owner is { Length: > 0 } o ? $"({o})" : ""), 15, item.Support == 0 ? Palette.Tertiary : Palette.Ink));+ row.Children.Add(Ui.Text(item.WithOwner, 15, item.Support == 0 ? Palette.Tertiary : Palette.Ink));block.Children.Add(row);}article.Children.Add(new Border { Background = Palette.Mica, CornerRadius = new CornerRadius(16), Padding = new Thickness(26, 22, 26, 22), Child = block, Margin = new Thickness(0, 0, 0, 32) });diff --git a/windows/src/Cicada/NotesWindow.cs b/windows/src/Cicada/NotesWindow.csindex 4fcd327..9a11c3e 100644--- a/windows/src/Cicada/NotesWindow.cs+++ b/windows/src/Cicada/NotesWindow.cs@@ -811,7 +811,7 @@ sealed class NotesWindow : Windowdock.Children.Add(box);var text = new TextBlock { TextWrapping = TextWrapping.Wrap, FontSize = 14, FontFamily = Palette.Font, Foreground = Palette.Ink };text.Inlines.Add(new System.Windows.Documents.Run(todo.Text));- if (todo.Owner is { Length: > 0 } owner) text.Inlines.Add(new System.Windows.Documents.Run($" · {owner}") { Foreground = Palette.Secondary });+ if (todo.OwnerShown is { } owner) text.Inlines.Add(new System.Windows.Documents.Run($" · {owner}") { Foreground = Palette.Secondary });dock.Children.Add(text);return dock;}diff --git a/windows/tests/Cicada.Tests/Program.cs b/windows/tests/Cicada.Tests/Program.csindex 3a4528c..42afa06 100644--- a/windows/tests/Cicada.Tests/Program.cs+++ b/windows/tests/Cicada.Tests/Program.cs@@ -1005,6 +1005,26 @@ static class Tests// MARK: Strings+ /// The notes store a to-do's owner as the transcript's Chinese label; it shows and exports in the UI language.+ public static void TodoOwnersShowInTheUILanguage()+ {+ var res = Path.Combine(AppContext.BaseDirectory, "Resources");+ try+ {+ Strings.Load(res, "en");+ Equal("Them", new NoteItem { Owner = "对方" }.OwnerShown, "them");+ Equal("You", new NoteItem { Owner = "你" }.OwnerShown, "you");+ Equal("Speaker 2", new NoteItem { Owner = "说话人2" }.OwnerShown, "speaker");+ Equal("Alice", new NoteItem { Owner = "Alice" }.OwnerShown, "a name stays");+ var s = new Session { Notes = new MeetingNotes { Summary = "s", Todos = [new NoteItem { Text = "Send the deck", Owner = "对方" }] } };+ Check(SessionStore.Markdown(s).Contains("- [ ] Send the deck (Them)"), "export: " + SessionStore.Markdown(s));+ Equal("Misheard words fixed: 3", Strings.LF("改了 %lld 处听错的词", 3), "banner");+ Strings.Load(res, "zh-Hans");+ Equal("发资料(对方)", new NoteItem { Text = "发资料", Owner = "对方" }.WithOwner, "Chinese");+ }+ finally { Strings.Load(res, "zh-Hans"); }+ }+public static void LoadsTheMacsTranslations(){Strings.Load(Path.Combine(AppContext.BaseDirectory, "Resources"), "en");