refactor: switch the whole project to English

talk is going to be published. Code comments, CLI output, error messages,
daemon log lines, MCP descriptions and results, test names and assertions,
README, spec, skill, build scripts and flake are now English. Only the
spoken announcement texts stay bilingual: the wrap result and the test
sentence are German or English depending on the detected language.

Language fallback is now configurable: `lang = "en" | "de"` (env
TALK_LANG, default en) is used when detection cannot tell (numbers, single
words, ties) and for talk's own announcements. langdetect.Detect takes the
fallback as an argument instead of hard-coding German. `talk setup` asks for
it; `talk doctor` and `talk status` show it.

Vocabulary pinned across packages so the process-boundary tests observe
stable strings: chain log lines ("chain: tier X skipped (not available)",
"falling back to the next tier", "spoken via X"), queue lines ("discarded:
quiet hours ... active", "replaced by toast", "max_age"), CLI notes
("speaking directly", "daemon started at", "no daemon", "nothing to cancel"),
status block with aligned English labels, MCP messages, origin guard 403.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
m3ta-chironandClaude Fable 5.1 committed 2026-10-24 11:15:35 +02:00
1 parent 4d30bd95ad
commit 85fa64cfe6
95 files changed
+4707 -4854

No files matched your search

+16 -19
View File
@@ -10,20 +10,18 @@ import (
"github.com/ebitengine/oto/v3"
)
// OtoSink spielt Audio embedded über oto (github.com/ebitengine/oto/v3,
// gepinnt auf v3.5.0) ab — kein externer Player nötig. oto lädt die
// Audiotreiber zur Laufzeit ohne CGO (purego), dadurch bleibt talk
// cross-compilierbar.
// OtoSink plays audio embedded via oto (github.com/ebitengine/oto/v3,
// pinned to v3.5.0); no external player needed. oto loads the audio drivers
// at runtime without CGO (purego), which keeps talk cross-compilable.
type OtoSink struct{}
// Name implementiert Sink.
// Name implements Sink.
func (OtoSink) Name() string { return NameOto }
// contextCache hält je PCM-Format einen oto-Kontext vor: oto unterstützt
// nur EINEN Kontext pro Prozess ("Creating multiple contexts is NOT
// supported"), und ein Kontext ist an genau ein Format gebunden. Die CLI
// spielt pro Prozess einmal (Task 02); der Daemon (Task 04) profitiert vom
// Cache.
// contextCache keeps one oto context per PCM format: oto supports only ONE
// context per process ("Creating multiple contexts is NOT supported"), and
// a context is bound to exactly one format. The CLI plays once per process;
// the daemon benefits from the cache.
var contextCache = struct {
sync.Mutex
byFormat map[pcmFormat]*otoContext
@@ -34,7 +32,7 @@ type otoContext struct {
ready chan struct{}
}
// otoFormat mappt ein PCM-Format auf das oto-Format.
// otoFormat maps a PCM format to the oto format.
func (f pcmFormat) otoFormat() oto.Format {
switch {
case f.Float:
@@ -46,7 +44,7 @@ func (f pcmFormat) otoFormat() oto.Format {
}
}
// contextFor liefert den (gecachten) oto-Kontext für ein Format.
// contextFor returns the (cached) oto context for a format.
func contextFor(f pcmFormat) (*otoContext, error) {
contextCache.Lock()
defer contextCache.Unlock()
@@ -60,17 +58,16 @@ func contextFor(f pcmFormat) (*otoContext, error) {
}
ctx, ready, err := oto.NewContext(op)
if err != nil {
return nil, fmt.Errorf("oto: Kontext (Audio-Gerät?) fehlgeschlagen: %w", err)
return nil, fmt.Errorf("oto: creating context failed (no audio device?): %w", err)
}
c := &otoContext{ctx: ctx, ready: ready}
contextCache.byFormat[f] = c
return c, nil
}
// Play implementiert Sink: dekodiert die Daten (RIFF/WAVE-PCM von osbuiltin
// oder MP3 von den Cloud-Providern, siehe mp3.go) und spielt die Samples
// blockierend ab. Fehler des Audio-Geräts oder des Formats werden klar
// gemeldet.
// Play implements Sink: decodes the data (RIFF/WAVE PCM from osbuiltin or
// MP3 from the cloud providers, see mp3.go) and plays the samples, blocking.
// Audio device and format errors are reported clearly.
func (OtoSink) Play(ctx context.Context, data []byte) error {
f, pcm, err := decodeAudio(data)
if err != nil {
@@ -83,7 +80,7 @@ func (OtoSink) Play(ctx context.Context, data []byte) error {
select {
case <-c.ready:
if err := c.ctx.Err(); err != nil {
return fmt.Errorf("oto: Initialisierung fehlgeschlagen: %w", err)
return fmt.Errorf("oto: initialization failed: %w", err)
}
case <-ctx.Done():
return ctx.Err()
@@ -98,7 +95,7 @@ func (OtoSink) Play(ctx context.Context, data []byte) error {
return err
}
if err := player.Err(); err != nil {
return fmt.Errorf("oto: Wiedergabe fehlgeschlagen: %w", err)
return fmt.Errorf("oto: playback failed: %w", err)
}
time.Sleep(5 * time.Millisecond)
}