Commit Graph
1 Commits
Author SHA1 Message Date
Vũ Thế Huy 10192f05d5 feat(translate): add Amazon Translate mock service (#2879)
* feat(translate): add Amazon Translate mock service

JSON 1.1 stub for Amazon Translate covering the three self-contained sync
operations: TranslateText, TranslateDocument, ListLanguages. Follows the
existing Comprehend/Textract stub pattern (stateless, echoes input,
AI_MOCK_CONFIG override for TranslateText).

- TranslateText echoes Text, enforces the 10,000-byte limit, allows any
  language pair; an auto source is reported back as en.
- TranslateDocument echoes the base64 Content and enforces the English-pivot
  rule, the ContentType allow-list, valid base64, and the 100 KB cap
  (InvalidRequestException, matching the operation's error model). The
  encoded length is checked before decoding so an oversized payload cannot
  force a large allocation.
- ListLanguages returns a fixed ~35-language catalog; DisplayLanguageCode is
  validated, pagination inputs are accepted but ignored.

Untrusted request values are truncated before being echoed into error
messages.

* chore(translate): remove em-dashes per AGENTS.md style guide

Replace em-dashes in the Translate doc page and Java comments with colons,
commas, or periods, and the ellipsis in the error-message preview helper
with "...". Addresses the Greptile review note on PR #2879.
2026-09-01 14:47:33 -04:00