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.

feat: Settings › Word list keeps the spellings you use, and takes many at once by pasting

wqugurud0878107672e
diff --git a/README.en.md b/README.en.md
index b5f5ffe..4e8e0ec 100644
--- a/README.en.md
+++ b/README.en.md
@@ -50,6 +50,8 @@ All four share one version number and one meeting record format; downloads are o
While the meeting runs, the notes window organizes a summary, topics and key points, conclusions, to-dos, a fishbone diagram, and a glossary of names and terms, and every conclusion or to-do clicks straight back to the supporting lines in the bilingual transcript. Cicada unifies names and terms across the notes and remembers misrecognized spellings, so `⌘F` searches both the canonical spelling and the variants. When the AI service has a problem only you can fix (key, credit, model), the notes window says so and the menu bar icon gets an orange dot; when **Turn on mic** can't get the microphone, the notes window, the subtitle bar and the menu bar icon all say so.
+Misheard names and terms are fixed as you go (needs an AI service): sound-alike mistakes are fixed right away, and a name it hasn't seen is asked about once in the notes window, then fixed from then on. Fixed words are underlined with dots; point at the paragraph to see what was heard, or revert it. Paste the spellings you use into Settings › Word list.
+
### Live subtitles and language detection
Cicada detects the spoken language on device within seconds and translates into your system language, and pressing `⌃⌥S` switches between the notes window, a compact subtitle bar, and hidden. The subtitle bar appears only when someone speaks and turns see-through under your pointer so you can click right through it. On macOS 26 with Apple silicon, the Transcript also hears the meeting a second time on the Mac and refines each line 15–30 seconds after it is said: fewer misheard words and none lost where the subtitles cut a line, while subtitles stay as fast.
diff --git a/README.ja.md b/README.ja.md
index e1b1e92..45b4fe3 100644
--- a/README.ja.md
+++ b/README.ja.md
@@ -52,6 +52,8 @@ Cicada は、Zoom、Teams、Feishu の通話から、X スペース、Discord
会議の進行中、メモのウィンドウには、要約、トピックと要点、結論、ToDo、フィッシュボーン図、人名と用語の用語集が整理され、各結論や ToDo をクリックすると、二か国語の書き起こしの根拠となる行に直接戻れます。Cicada はメモ全体で人名と用語を統一し、誤って認識された表記を覚えているので、`⌘F` では正規の表記とその揺れの両方を検索できます。AI サービスにあなたにしか直せない問題(キー、残高、モデル)があるときは、メモのウィンドウが知らせ、メニューバーのアイコンにオレンジの点が付きます。マイクをオンにしたのにマイクが使えないときは、メモのウィンドウ、字幕バー、メニューバーのアイコンのすべてで知らせます。
+聞き間違えた人名や用語はその場で直します(AI サービスが必要)。発音の近い誤りはすぐ直し、初めての名前はメモウィンドウで一度だけ確認し、「はい」と答えるとそれ以降は自動で直します。直した語には点線が付き、その段落を指すと元の認識結果を見たり元に戻したりできます。よく使う表記は設定の「単語リスト」にまとめて貼り付けられます。
+
### リアルタイムの字幕と言語の検出
Cicada は、話されている言語を数秒以内にデバイス上で検出してシステムの言語に翻訳し、`⌃⌥S` を押すと、メモのウィンドウ、コンパクトな字幕バー、非表示を切り替えられます。字幕バーは誰かが話しているときにだけ表示され、ポインターを重ねると透けるので、その下をそのままクリックできます。Apple シリコン搭載の macOS 26 では、文字起こしがデバイス上で会議をもう一度聞き直し、各行を話してから 15〜30 秒後に補正します。誤認識が減り、字幕の区切りで言葉が抜けることもなく、字幕の速さはそのままです。
diff --git a/README.ko.md b/README.ko.md
index 243a64b..1d02611 100644
--- a/README.ko.md
+++ b/README.ko.md
@@ -50,6 +50,8 @@ Zoom, Teams, Feishu 회의부터 X Spaces, Discord 스테이지, YouTube 라이
회의가 진행되는 동안 회의록 창에서 요약, 안건 및 요점, 결론, 할 일, 피시본 다이어그램, 인명·용어집을 실시간으로 정리합니다. 결론이나 할 일을 클릭하면 이중 언어 기록의 해당 발언으로 바로 이동합니다. 회의록 전체에서 인명과 용어 표기를 통일하고 잘못 인식된 표기도 기억하므로, `⌘F`로 검색하면 표준 표기와 오인식된 변형을 함께 찾아줍니다. AI 서비스에 내가 직접 고쳐야 하는 문제(키, 잔액, 모델)가 생기면 회의록 창이 알려 주고 메뉴 막대 아이콘에 주황색 점이 붙습니다. 마이크를 켰는데 마이크를 쓸 수 없을 때는 회의록 창, 자막 바, 메뉴 막대 아이콘 모두에서 알려 줍니다.
+잘못 들은 이름과 용어를 그 자리에서 고칩니다(AI 서비스 필요). 발음이 비슷한 오류는 바로 고치고, 처음 보는 이름은 회의록 창에서 한 번 물어본 뒤 ‘네’라고 하면 그다음부터 자동으로 고칩니다. 고친 단어에는 점선이 표시되고, 그 단락을 가리키면 원래 인식된 내용을 보거나 되돌릴 수 있습니다. 자주 쓰는 표기는 설정의 ‘단어 목록’에 한꺼번에 붙여 넣을 수 있습니다.
+
### 실시간 자막 및 언어 감지
상대방이 말하기 시작하면 몇 초 안에 기기에서 언어를 감지해 시스템 언어로 번역합니다. `⌃⌥S`를 누르면 회의록 창, 자막 바, 숨김 상태를 오갈 수 있습니다. 자막 바는 누군가 말할 때만 나타나며, 마우스 포인터를 올리면 투명해져 아래에 있는 버튼을 그대로 클릭할 수 있습니다. Apple Silicon 탑재 macOS 26에서는 대화 기록이 기기에서 회의를 한 번 더 듣고, 각 줄을 말한 뒤 15~30초 후에 보정합니다. 잘못 들은 단어가 줄고 자막이 끊기는 곳에서 단어가 빠지지 않으며, 자막 속도는 그대로입니다.
diff --git a/README.md b/README.md
index bd86f3c..8862f52 100644
--- a/README.md
+++ b/README.md
@@ -48,6 +48,8 @@
开会时纪要窗口边听边整理总结、议题要点、结论、待办、鱼骨图和人名术语表,点一下结论或待办就能跳回双语文字记录里的原话。纪要会统一文中人名和术语的写法并记下听错的变体,按 `⌘F` 搜索时能连同识别错的写法一起搜出来。AI 服务出了只有你能修的问题(key、余额、模型)时,纪要窗口会说明,菜单栏图标多一个橙点;打开了麦克风却没拿到麦克风权限时,纪要窗口、字幕条和菜单栏图标都会提示。
+听错的人名和术语会当场改对(需要 AI 服务):读音相近的错字直接改,没见过的名字先在纪要窗口问你一次,答“对”以后就自动改;改过的词带虚线,指着那段话能看到原来听成什么,也能改回。常用的写法可以在设置的“词表”里一次贴进来。
+
### 实时字幕与语言识别
对方开口几秒钟就能在本地自动认出语言并翻成你的系统语言,按 `⌃⌥S` 可以在纪要窗口、字幕条和不显示之间切换。字幕条只在有人说话时出现,鼠标划过时自动变透明,不会挡住底下的按钮。在 Apple 芯片的 macOS 26 上,文字记录还会在本机把会议再听一遍,每句话说完 15 到 30 秒后校准好:错字更少,字幕断句的地方也不再丢字,字幕本身照样快。
diff --git a/Resources/en.lproj/Localizable.strings b/Resources/en.lproj/Localizable.strings
index 2ebe17d..e725132 100644
--- a/Resources/en.lproj/Localizable.strings
+++ b/Resources/en.lproj/Localizable.strings
@@ -1262,3 +1262,31 @@
"确认后整场一起改,以后也照此改" = "Fixes the whole meeting, and future ones";
"对" = "Yes";
"不对" = "No";
+
+/* WordListSettings: 词表 */
+"词表" = "Word list";
+"还没有词。把常用的人名、产品名贴进来,会中就照这些写法改" = "No words yet. Paste in the names and products you often say, and meetings will use these spellings.";
+"最多 %lld 个,满了优先用最近的。只存在这台 Mac 上" = "Up to %lld, recent ones first. Stored only on this Mac";
+"会中改正听错的词" = "Fix misheard words live";
+"走 %@,只发文字" = "Text only, via %@";
+"接上 AI 服务后才会改" = "Needs an AI service";
+"没见过的名字和专称先问我" = "Ask before fixing unfamiliar names";
+"关掉就只改词表里的词和同音错字" = "When off, only fixes listed words and sound-alike typos";
+"词" = "Words";
+"搜索词表" = "Search words";
+"粘贴导入…" = "Paste to import…";
+"会中确认" = "Confirmed";
+"你加的" = "Added by you";
+"改过 %lld 次" = "Fixed %lld times";
+"还没用上" = "Not used yet";
+"从词表里删掉" = "Remove from the list";
+"粘贴导入" = "Paste to import";
+"一行一个。常被听错的词,写在 = 后面" = "One per line. Put common mishearings after =";
+"新增 %lld · 更新 %lld · 跳过 %lld" = "%lld added · %lld updated · %lld skipped";
+"第 %@ 行没加进去:超过 40 个字" = "Line %@ not added: over 40 characters";
+
+/* AISettings: 改正听错的词 */
+"改正听错的词" = "Fix misheard words";
+"已关" = "Off";
+"随翻译一起发,几乎不多花" = "Sent with the translation, barely any extra cost";
+"在“词表”里打开" = "Turn on in Word list";
diff --git a/Resources/ja.lproj/Localizable.strings b/Resources/ja.lproj/Localizable.strings
index 5a5e0b4..61e5de5 100644
--- a/Resources/ja.lproj/Localizable.strings
+++ b/Resources/ja.lproj/Localizable.strings
@@ -1262,3 +1262,31 @@
"确认后整场一起改,以后也照此改" = "会議全体に反映し、次回からも同じく直します";
"对" = "はい";
"不对" = "いいえ";
+
+/* WordListSettings: 词表 */
+"词表" = "単語リスト";
+"还没有词。把常用的人名、产品名贴进来,会中就照这些写法改" = "まだ単語がありません。よく使う人名や製品名を貼り付けると、会議中にこの表記で直します";
+"最多 %lld 个,满了优先用最近的。只存在这台 Mac 上" = "最大 %lld 個、最近使ったものを優先。この Mac にだけ保存";
+"会中改正听错的词" = "会議中に聞き間違いを直す";
+"走 %@,只发文字" = "%@ 経由、テキストのみ";
+"接上 AI 服务后才会改" = "AI サービスに接続すると使えます";
+"没见过的名字和专称先问我" = "知らない名前は先に確認する";
+"关掉就只改词表里的词和同音错字" = "オフにすると単語リストの語と同音の誤りだけを直します";
+"词" = "単語";
+"搜索词表" = "単語を検索";
+"粘贴导入…" = "貼り付けて追加…";
+"会中确认" = "会議中に確認";
+"你加的" = "自分で追加";
+"改过 %lld 次" = "%lld 回修正";
+"还没用上" = "まだ未使用";
+"从词表里删掉" = "リストから削除";
+"粘贴导入" = "貼り付けて追加";
+"一行一个。常被听错的词,写在 = 后面" = "1 行に 1 つ。よくある聞き間違いは = の後に";
+"新增 %lld · 更新 %lld · 跳过 %lld" = "追加 %lld · 更新 %lld · スキップ %lld";
+"第 %@ 行没加进去:超过 40 个字" = "%@ 行目は追加されませんでした:40 文字を超えています";
+
+/* AISettings: 改正听错的词 */
+"改正听错的词" = "聞き間違いの修正";
+"已关" = "オフ";
+"随翻译一起发,几乎不多花" = "翻訳と一緒に送るので、追加費用はほぼなし";
+"在“词表”里打开" = "「単語リスト」でオン";
diff --git a/Resources/ko.lproj/Localizable.strings b/Resources/ko.lproj/Localizable.strings
index 52b6d28..8f1ce88 100644
--- a/Resources/ko.lproj/Localizable.strings
+++ b/Resources/ko.lproj/Localizable.strings
@@ -1262,3 +1262,31 @@
"确认后整场一起改,以后也照此改" = "회의 전체에 적용하고 다음부터도 이렇게 고칩니다";
"对" = "네";
"不对" = "아니요";
+
+/* WordListSettings: 词表 */
+"词表" = "단어 목록";
+"还没有词。把常用的人名、产品名贴进来,会中就照这些写法改" = "아직 단어가 없습니다. 자주 쓰는 이름과 제품명을 붙여 넣으면 회의 중 이 표기로 고칩니다";
+"最多 %lld 个,满了优先用最近的。只存在这台 Mac 上" = "최대 %lld개, 최근 것을 우선. 이 Mac에만 저장";
+"会中改正听错的词" = "회의 중 잘못 들은 단어 고치기";
+"走 %@,只发文字" = "%@ 사용, 텍스트만 전송";
+"接上 AI 服务后才会改" = "AI 서비스를 연결하면 사용할 수 있습니다";
+"没见过的名字和专称先问我" = "처음 보는 이름은 먼저 물어보기";
+"关掉就只改词表里的词和同音错字" = "끄면 목록의 단어와 발음이 같은 오류만 고칩니다";
+"词" = "단어";
+"搜索词表" = "단어 검색";
+"粘贴导入…" = "붙여 넣어 추가…";
+"会中确认" = "회의 중 확인";
+"你加的" = "직접 추가";
+"改过 %lld 次" = "%lld번 고침";
+"还没用上" = "아직 안 씀";
+"从词表里删掉" = "목록에서 삭제";
+"粘贴导入" = "붙여 넣어 추가";
+"一行一个。常被听错的词,写在 = 后面" = "한 줄에 하나. 자주 잘못 듣는 형태는 = 뒤에";
+"新增 %lld · 更新 %lld · 跳过 %lld" = "추가 %lld · 업데이트 %lld · 건너뜀 %lld";
+"第 %@ 行没加进去:超过 40 个字" = "%@번째 줄은 추가되지 않았습니다: 40자 초과";
+
+/* AISettings: 改正听错的词 */
+"改正听错的词" = "잘못 들은 단어 고치기";
+"已关" = "꺼짐";
+"随翻译一起发,几乎不多花" = "번역과 함께 보내 추가 비용이 거의 없음";
+"在“词表”里打开" = "‘단어 목록’에서 켜기";
diff --git a/Resources/zh-Hans.lproj/Localizable.strings b/Resources/zh-Hans.lproj/Localizable.strings
index 18cd77b..8acdaa2 100644
--- a/Resources/zh-Hans.lproj/Localizable.strings
+++ b/Resources/zh-Hans.lproj/Localizable.strings
@@ -1262,3 +1262,31 @@
"确认后整场一起改,以后也照此改" = "确认后整场一起改,以后也照此改";
"对" = "对";
"不对" = "不对";
+
+/* WordListSettings: 词表 */
+"词表" = "词表";
+"还没有词。把常用的人名、产品名贴进来,会中就照这些写法改" = "还没有词。把常用的人名、产品名贴进来,会中就照这些写法改";
+"最多 %lld 个,满了优先用最近的。只存在这台 Mac 上" = "最多 %lld 个,满了优先用最近的。只存在这台 Mac 上";
+"会中改正听错的词" = "会中改正听错的词";
+"走 %@,只发文字" = "走 %@,只发文字";
+"接上 AI 服务后才会改" = "接上 AI 服务后才会改";
+"没见过的名字和专称先问我" = "没见过的名字和专称先问我";
+"关掉就只改词表里的词和同音错字" = "关掉就只改词表里的词和同音错字";
+"词" = "词";
+"搜索词表" = "搜索词表";
+"粘贴导入…" = "粘贴导入…";
+"会中确认" = "会中确认";
+"你加的" = "你加的";
+"改过 %lld 次" = "改过 %lld 次";
+"还没用上" = "还没用上";
+"从词表里删掉" = "从词表里删掉";
+"粘贴导入" = "粘贴导入";
+"一行一个。常被听错的词,写在 = 后面" = "一行一个。常被听错的词,写在 = 后面";
+"新增 %lld · 更新 %lld · 跳过 %lld" = "新增 %lld · 更新 %lld · 跳过 %lld";
+"第 %@ 行没加进去:超过 40 个字" = "第 %@ 行没加进去:超过 40 个字";
+
+/* AISettings: 改正听错的词 */
+"改正听错的词" = "改正听错的词";
+"已关" = "已关";
+"随翻译一起发,几乎不多花" = "随翻译一起发,几乎不多花";
+"在“词表”里打开" = "在“词表”里打开";
diff --git a/Sources/Cicada/AISettings.swift b/Sources/Cicada/AISettings.swift
index 6e343ff..8c44e7e 100644
--- a/Sources/Cicada/AISettings.swift
+++ b/Sources/Cicada/AISettings.swift
@@ -589,6 +589,12 @@ struct AISettingsView: View {
note: textOn ? (Recognition.hasOnDeviceTranslation ? L("整句用它;不行时换 Google、本机") : L("整句用它;不行时换 Google"))
: ling.hasKey ? L("先用 Google 翻译") : L("没有 key 时照常可用"))
}
+ if !Recognition.cloudOnly {
+ let fixOn = textOn && settings.fixMisheard
+ usageRow(L("改正听错的词"), tag: fixOn ? uses : textOn ? L("已关") : ling.hasKey ? L("暂不可用") : L("需要 key"),
+ style: fixOn ? .ok : .off,
+ note: fixOn ? L("随翻译一起发,几乎不多花") : textOn ? L("在“词表”里打开") : later)
+ }
let speaks = ling.speaks && !down
usageRow(L("同传声音"), tag: speaks ? uses : L("本机"), style: speaks ? .ok : .off, note: voiceNote(down: down))
if provider.clones {
diff --git a/Sources/Cicada/SettingsWindow.swift b/Sources/Cicada/SettingsWindow.swift
index 389a0b0..6d18ddf 100644
--- a/Sources/Cicada/SettingsWindow.swift
+++ b/Sources/Cicada/SettingsWindow.swift
@@ -3,12 +3,13 @@ import Carbon.HIToolbox
import SwiftUI
enum SettingsSection: String, CaseIterable, Identifiable {
- case overlay, language, speak, records, ai, diagnostics
+ case overlay, language, words, speak, records, ai, diagnostics
var id: String { rawValue }
var title: String {
switch self {
case .overlay: L("显示")
case .language: L("语言")
+ case .words: L("词表")
case .speak: L("同声传译")
case .records: L("通用")
case .ai: L("AI 服务")
@@ -19,6 +20,7 @@ enum SettingsSection: String, CaseIterable, Identifiable {
switch self {
case .overlay: "captions.bubble"
case .language: "globe"
+ case .words: "character.book.closed"
case .speak: "mic"
case .records: "gearshape"
case .ai: "key"
@@ -438,6 +440,7 @@ struct SettingsView: View {
case .speak: speak
case .overlay: overlay
case .language: LanguageSettings(model: model, settings: settings)
+ case .words: WordListSettings(model: model, settings: settings, vocabulary: model.vocabulary, ling: model.ling)
case .records: records
case .ai: AISettingsView(model: model, ling: model.ling, settings: settings)
case .diagnostics: DiagnosticsView(diagnostics: model.diagnostics, service: settings.aiConfig)
diff --git a/Sources/Cicada/WordListSettings.swift b/Sources/Cicada/WordListSettings.swift
new file mode 100644
index 0000000..815f57a
--- /dev/null
+++ b/Sources/Cicada/WordListSettings.swift
@@ -0,0 +1,153 @@
+import SwiftUI
+
+/// 设置 › 词表: the switches for 改正听错的词, and the word list itself (`Vocabulary`): each word,
+/// what it has been heard as, where it came from and how often it fixed a line.
+struct WordListSettings: View {
+ @ObservedObject var model: AppModel
+ @ObservedObject var settings: AppSettings
+ @ObservedObject var vocabulary: Vocabulary
+ @ObservedObject var ling: LingClient
+ @State private var importing = false
+ @State private var query = ""
+
+ var body: some View {
+ VStack(alignment: .leading, spacing: 14) {
+ SettingsCard {
+ SettingsRow(title: L("会中改正听错的词"),
+ detail: ling.usable ? L("走 \(ling.provider.name),只发文字") : L("接上 AI 服务后才会改")) {
+ Toggle("会中改正听错的词", isOn: $settings.fixMisheard)
+ .toggleStyle(.switch).labelsHidden().controlSize(.small).tint(Palette.ink)
+ }
+ SettingsRow(title: L("没见过的名字和专称先问我"), detail: L("关掉就只改词表里的词和同音错字"), divider: false) {
+ Toggle("没见过的名字和专称先问我", isOn: $settings.askNames)
+ .toggleStyle(.switch).labelsHidden().controlSize(.small).tint(Palette.ink)
+ .disabled(!settings.fixMisheard)
+ }
+ }
+
+ HStack(spacing: 10) {
+ Text("词").font(.system(size: 13, weight: .semibold)).foregroundStyle(Palette.secondary)
+ if !vocabulary.terms.isEmpty {
+ Text("\(vocabulary.terms.count)").font(.system(size: 12).monospacedDigit()).foregroundStyle(Palette.tertiary)
+ }
+ Spacer()
+ if vocabulary.terms.count > 12 {
+ TextField("搜索词表", text: $query).textFieldStyle(.roundedBorder).frame(width: 160).controlSize(.small)
+ }
+ SoftButton(L("粘贴导入…"), dark: true) { importing = true }
+ }
+ .padding(.top, 4)
+
+ if vocabulary.terms.isEmpty {
+ Text("还没有词。把常用的人名、产品名贴进来,会中就照这些写法改")
+ .font(.system(size: 12)).foregroundStyle(Palette.tertiary)
+ .frame(maxWidth: .infinity, alignment: .leading).padding(.vertical, 6)
+ } else {
+ SettingsCard {
+ let list = shown
+ ForEach(Array(list.enumerated()), id: \.element.word) { i, t in
+ WordRow(term: t, divider: i < list.count - 1) { vocabulary.remove(t.word) }
+ }
+ }
+ }
+ Text("最多 \(Vocabulary.limit) 个,满了优先用最近的。只存在这台 Mac 上")
+ .font(.system(size: 11)).foregroundStyle(Palette.tertiary)
+ }
+ .sheet(isPresented: $importing) { WordImportSheet(vocabulary: vocabulary) }
+ }
+
+ /// Most recently useful first, then the rest by when they were added.
+ private var shown: [Vocabulary.Term] {
+ let q = Vocabulary.key(query)
+ let all = vocabulary.terms.reversed().sorted { ($0.used ?? .distantPast) > ($1.used ?? .distantPast) }
+ guard !q.isEmpty else { return all }
+ return all.filter { Vocabulary.key($0.word).contains(q) || $0.heard.contains { Vocabulary.key($0).contains(q) } }
+ }
+}
+
+private struct WordRow: View {
+ let term: Vocabulary.Term
+ let divider: Bool
+ let onRemove: () -> Void
+ @State private var hovering = false
+
+ var body: some View {
+ VStack(spacing: 0) {
+ HStack(alignment: .center, spacing: 12) {
+ Text(term.word).font(.system(size: 13, weight: .semibold)).foregroundStyle(Palette.ink)
+ .frame(width: 140, alignment: .leading).lineLimit(1)
+ FlowLayout(spacing: 4) {
+ ForEach(term.heard, id: \.self) { h in
+ Text(h).font(.system(size: 11)).foregroundStyle(Palette.secondary)
+ .padding(.horizontal, 6).padding(.vertical, 2)
+ .background(RoundedRectangle(cornerRadius: 5).fill(Palette.fill))
+ }
+ }
+ .frame(maxWidth: .infinity, alignment: .leading)
+ Text(term.source == "live" ? L("会中确认") : L("你加的"))
+ .font(.system(size: 11)).foregroundStyle(term.source == "live" ? Palette.accentInk : Palette.tertiary)
+ .lineLimit(1).fixedSize().frame(minWidth: 60, alignment: .leading)
+ Text(term.fixes > 0 ? L("改过 \(term.fixes) 次") : L("还没用上"))
+ .font(.system(size: 11).monospacedDigit()).foregroundStyle(Palette.tertiary)
+ .lineLimit(1).fixedSize().frame(minWidth: 64, alignment: .leading)
+ Button(action: onRemove) {
+ Image(systemName: "trash").font(.system(size: 11)).foregroundStyle(Palette.tertiary)
+ }
+ .buttonStyle(.plain).help(L("从词表里删掉")).opacity(hovering ? 1 : 0.35)
+ }
+ .padding(.horizontal, 16).frame(minHeight: 40)
+ if divider { Divider().padding(.leading, 16) }
+ }
+ .onHover { hovering = $0 }
+ }
+}
+
+/// 粘贴导入: many words at once, each line one word, heard forms after "=". Lines that can't be
+/// taken are reported by number; the rest go in.
+private struct WordImportSheet: View {
+ @ObservedObject var vocabulary: Vocabulary
+ @Environment(\.dismiss) private var dismiss
+ @State private var text = ""
+ @State private var result: Vocabulary.ImportResult?
+
+ var body: some View {
+ VStack(alignment: .leading, spacing: 12) {
+ Text("粘贴导入").font(.system(size: 15, weight: .bold)).foregroundStyle(Palette.ink)
+ Text("一行一个。常被听错的词,写在 = 后面").font(.system(size: 12)).foregroundStyle(Palette.secondary)
+ TextEditor(text: $text)
+ .font(.system(size: 13)).frame(height: 180)
+ .overlay(alignment: .topLeading) {
+ if text.isEmpty {
+ Text(verbatim: "Uniswap V3\nMorpho = 莫拉、莫法\n巡检")
+ .font(.system(size: 13)).foregroundStyle(Palette.placeholder).padding(.leading, 5).padding(.top, 1)
+ .allowsHitTesting(false)
+ }
+ }
+ .padding(6)
+ .background(RoundedRectangle(cornerRadius: 8).fill(Color.white))
+ .overlay(RoundedRectangle(cornerRadius: 8).stroke(Palette.line, lineWidth: 1))
+ if let r = result {
+ VStack(alignment: .leading, spacing: 4) {
+ Text("新增 \(r.added) · 更新 \(r.updated) · 跳过 \(r.skipped.count)")
+ .font(.system(size: 12, weight: .medium)).foregroundStyle(Palette.ink)
+ if !r.skipped.isEmpty {
+ Text("第 \(r.skipped.map(String.init).joined(separator: "、")) 行没加进去:超过 40 个字")
+ .font(.system(size: 11)).foregroundStyle(Palette.accentInk)
+ }
+ }
+ }
+ HStack {
+ Spacer()
+ SoftButton(result == nil ? L("取消") : L("完成")) { dismiss() }
+ if result == nil {
+ SoftButton(L("导入"), dark: true) {
+ result = vocabulary.importText(text)
+ text = ""
+ }
+ .disabled(text.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty)
+ }
+ }
+ }
+ .padding(20).frame(width: 420)
+ }
+}
diff --git a/site/changelog.json b/site/changelog.json
index 2455789..3b8efd2 100644
--- a/site/changelog.json
+++ b/site/changelog.json
@@ -21,6 +21,14 @@
],
"title": "开会时听错的人名和术语,字幕和纪要里当场就改对(需要 AI 服务)。",
"text": "每句话说完,翻译时顺带找出听错的词:读音相近的错字(质压 → 质押)直接改,没见过的名字(莫拉 → Morpho)先在纪要窗口问一次“这样改对吗?”,答“对”以后就自动改。改过的词带虚线,指着这段话能看到原来听成什么,点“改回”就恢复。导出和纪要用改后的文字,记录里仍留着原来听到的。"
+ },
+ {
+ "kind": "new",
+ "platforms": [
+ "mac"
+ ],
+ "title": "设置里多了“词表”:常用的人名、产品名一次贴进来,会中就照这些写法改。",
+ "text": "一行一个,常被听错的写法写在 = 后面(Morpho = 莫拉)。会中答“对”的词也会记进来,标着“会中确认”和改过几次。词表只存在这台 Mac 上,只发文字给你选的 AI 服务。"
}
]
},