Files
goclaw/internal/i18n/tts_gemini_text_only_test.go
viettranx 04a9938f4f feat(tts): wire tenant timeout + fix Gemini text-only 400
- HTTP synthesize + test-connection now read tenant tts.timeout_ms
  (default 120s, was hardcoded 15s/10s). Gemini client default also
  bumped 30s→120s so both layers align when tenant config unset.
- Inline prefix "Speak naturally: " prepended to single-voice text;
  multi-speaker transcripts pass through unchanged.
- ErrTextOnlyResponse sentinel for 400 "text generation" bodies;
  single-voice retries once with stronger prefix. Narrowed needle
  list avoids false positives on unrelated 400s.
- SynthesizeWithFallbackAdapted now returns errors.Join so sentinel
  survives fallback chain; HTTP 422 mapping + locale-translated
  ForLLM in agent tool (EN/VI/ZH catalogs).
- Default Gemini model bumped to gemini-3.1-flash-tts-preview.
2026-04-23 08:31:53 +07:00

22 lines
717 B
Go

package i18n
import "testing"
// TestI18nKey_TtsGeminiTextOnly_AllCatalogs verifies that MsgTtsGeminiTextOnly
// is present in all three locale catalogs and returns a translated string
// (not the key literal itself).
func TestI18nKey_TtsGeminiTextOnly_AllCatalogs(t *testing.T) {
locales := []string{LocaleEN, LocaleVI, LocaleZH}
for _, locale := range locales {
t.Run(locale, func(t *testing.T) {
got := T(locale, MsgTtsGeminiTextOnly)
if got == "" {
t.Errorf("locale %q: T returned empty string for MsgTtsGeminiTextOnly", locale)
}
if got == MsgTtsGeminiTextOnly {
t.Errorf("locale %q: T returned key literal %q — key missing from catalog", locale, MsgTtsGeminiTextOnly)
}
})
}
}