From b457d19d9b2c634570300d0f73087e18b4ec4a4a Mon Sep 17 00:00:00 2001 From: wuhei Date: Thu, 19 Nov 2026 18:36:43 +0100 Subject: Enter keeps the sentence: green on screen, appended to a session log - Enter (kiosk) turns the sentence green and appends it to a Markdown session log, default sessions/session-.md, -log to override. Written lazily, so a run that kept nothing leaves no file. - logs the whole sentence rather than the 9 characters on screen; the snapshot waits 450ms so the model's lookahead has decoded the final syllables - the English in the log is a fresh translation of that sentence, done on a single ordered worker off the audio path, so it never delays recognition - green clears with the next sentence, like the red cut screen - double Enter within 2s does not duplicate a line - tests: keep state, sentence selection, log format and dedupe --- translate.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'translate.go') diff --git a/translate.go b/translate.go index 66cee26..508e5db 100644 --- a/translate.go +++ b/translate.go @@ -115,6 +115,9 @@ func (t *translator) run() { } } +// translateText is the synchronous form, used when a sentence is kept for the log. +func (t *translator) translateText(text string) (string, error) { return t.translate(text) } + func (t *translator) translate(text string) (string, error) { ctx, cancel := context.WithTimeout(context.Background(), 8*time.Second) defer cancel() -- cgit v1.2.3