fix(pitch-deck): hoist textLang const out of fetch object literal
All checks were successful
Build pitch-deck / build-push-deploy (push) Successful in 1m8s
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-consent (push) Successful in 30s
CI / test-python-voice (push) Successful in 33s
CI / test-bqas (push) Successful in 32s

Syntax error: const declaration was inside the options object.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Sharang Parnerkar
2026-04-17 08:16:19 +02:00
parent 030991cb9a
commit 39255f2c9e

View File

@@ -154,12 +154,10 @@ export default function ChatFAB({
ttsAbortRef.current = controller ttsAbortRef.current = controller
try { try {
const textLang = /[äöüÄÖÜß]|(?:^|\s)(?:das|die|der|und|ist|wir|ein|für|mit|auf|von|den|des)\s/i.test(cleanText) ? 'de' : lang
const res = await fetch('/api/presenter/tts', { const res = await fetch('/api/presenter/tts', {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
// Detect response language from text content (not UI language)
// German text typically contains umlauts, ß, or common German words
const textLang = /[äöüÄÖÜß]|(?:^|\s)(?:das|die|der|und|ist|wir|ein|für|mit|auf|von|den|des)\s/i.test(cleanText) ? 'de' : lang
body: JSON.stringify({ text: cleanText, language: textLang }), body: JSON.stringify({ text: cleanText, language: textLang }),
signal: controller.signal, signal: controller.signal,
}) })