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:
1 parent
4d30bd95ad
commit
85fa64cfe6
95 files changed
+4707
-4854
No files matched your search
+12
-11
@@ -6,15 +6,16 @@ import (
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
// Spawn startet `exe daemon run` als eigenständigen Hintergrundprozess
|
||||
// (eigene Session bzw. eigene Prozessgruppe, losgelöst vom Terminal), mit
|
||||
// stdout/stderr in die Log-Datei logPath (pro Start neu angelegt; leer =
|
||||
// verwerfen). env ist die Umgebung des Kindes (Keys, TALK_*-Overrides).
|
||||
// Spawn starts `exe daemon run` as an independent background process (own
|
||||
// session or own process group, detached from the terminal), with
|
||||
// stdout/stderr going to the log file logPath (created fresh per start;
|
||||
// empty = discard). env is the child's environment (keys, TALK_*
|
||||
// overrides).
|
||||
//
|
||||
// Rückgabe ist ein Kanal, der genau einmal das Wait-Ergebnis liefert, wenn
|
||||
// das Kind endet — der Aufrufer erkennt daran einen fehlgeschlagenen Start
|
||||
// (z. B. Port belegt), ohne auf einen Timeout warten zu müssen. Endet der
|
||||
// Aufrufer zuerst, läuft der Daemon weiter (das ist der Zweck).
|
||||
// The return value is a channel that delivers the Wait result exactly once
|
||||
// when the child exits; the caller uses it to detect a failed start (e.g.
|
||||
// port in use) without waiting for a timeout. If the caller exits first,
|
||||
// the daemon keeps running (that is the point).
|
||||
func Spawn(exe, logPath string, env []string) (<-chan error, error) {
|
||||
var logFile *os.File
|
||||
if logPath == "" {
|
||||
@@ -22,9 +23,9 @@ func Spawn(exe, logPath string, env []string) (<-chan error, error) {
|
||||
}
|
||||
logFile, err := os.OpenFile(logPath, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0o644)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Daemon-Log %s: %w", logPath, err)
|
||||
return nil, fmt.Errorf("daemon log %s: %w", logPath, err)
|
||||
}
|
||||
defer logFile.Close() // das Kind hält sein eigenes Handle
|
||||
defer logFile.Close() // the child holds its own handle
|
||||
|
||||
cmd := exec.Command(exe, "daemon", "run")
|
||||
cmd.Env = env
|
||||
@@ -33,7 +34,7 @@ func Spawn(exe, logPath string, env []string) (<-chan error, error) {
|
||||
cmd.Stderr = logFile
|
||||
detach(cmd)
|
||||
if err := cmd.Start(); err != nil {
|
||||
return nil, fmt.Errorf("Daemon starten (%s daemon run): %w", exe, err)
|
||||
return nil, fmt.Errorf("starting daemon (%s daemon run): %w", exe, err)
|
||||
}
|
||||
exited := make(chan error, 1)
|
||||
go func() { exited <- cmd.Wait() }()
|
||||
|
||||
Reference in new issue
Block a user