fix: increase reformulate word limit to 2000 + i18n error messages
Some checks failed
Deploy to Production / Build and Deploy (push) Failing after 4s

- Raise MAX_WORDS from 500 to 2000 for text reformulation
- Error messages now use i18n keys (ai.wordCountMin/Max) instead of
  hardcoded English strings
- Client translates server errors using the user's UI language

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-04-30 21:09:13 +02:00
parent fa72672aac
commit 907dcf33d6
5 changed files with 24 additions and 6 deletions

View File

@@ -42,7 +42,11 @@ export async function POST(request: NextRequest) {
// Validate word count
const validation = paragraphRefactorService.validateWordCount(text)
if (!validation.valid) {
return NextResponse.json({ error: validation.error }, { status: 400 })
return NextResponse.json({
error: validation.error,
errorKey: validation.errorKey,
params: validation.params,
}, { status: 400 })
}
// Use the ParagraphRefactorService