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(windows): the update download shows its progress as 39% instead of 39%%

wqugurudedc2dc05cfa
diff --git a/site/changelog.json b/site/changelog.json
index b04c592..4251f82 100644
--- a/site/changelog.json
+++ b/site/changelog.json
@@ -623,6 +623,14 @@
],
"title": "长会议的实时纪要里,议题的起止时间不再比里面的要点晚好几分钟。",
"text": ""
+ },
+ {
+ "kind": "fixed",
+ "platforms": [
+ "windows"
+ ],
+ "title": "Windows 下载新版本时,进度显示成“39%”,不再是“39%%”。",
+ "text": "托盘面板和 设置 › 关于 里的下载进度多了一个百分号。"
}
]
},
diff --git a/windows/src/Cicada.Core/Strings.cs b/windows/src/Cicada.Core/Strings.cs
index e4a90b1..bd46b84 100644
--- a/windows/src/Cicada.Core/Strings.cs
+++ b/windows/src/Cicada.Core/Strings.cs
@@ -63,6 +63,8 @@ public static class Strings
b.Append(n >= 0 && n < args.Length ? args[n] : "");
i += 3;
}
+ // A percent sign, written %% in a format ("正在下载 %@:%lld%%").
+ else if (text[i] == '%' && i + 1 < text.Length && text[i + 1] == '%') { b.Append('%'); i++; }
else b.Append(text[i]);
}
return b.ToString();
diff --git a/windows/tests/Cicada.Tests/Program.cs b/windows/tests/Cicada.Tests/Program.cs
index 7d8f802..cee60e9 100644
--- a/windows/tests/Cicada.Tests/Program.cs
+++ b/windows/tests/Cicada.Tests/Program.cs
@@ -772,6 +772,7 @@ static class Tests
Equal("x\ny", t["a \"b\""], "escapes");
Equal("%@ min", t["%@ 分钟"], "placeholders kept");
Equal("3 分钟", Strings.LF("%@ 分钟", 3), "LF fills %@");
+ Equal("正在下载 1.3.0:59%", Strings.LF("正在下载 %@:%lld%%", "1.3.0", 59), "%% is one percent sign");
}
// MARK: Ling