Claus Ibsen created CAMEL-26073:
-----------------------------------

             Summary: camel-aws2-translate - a language as option and the other 
as header sends no language, and the code of Croatian is cr
                 Key: CAMEL-26073
                 URL: https://issues.apache.org/jira/browse/CAMEL-26073
             Project: Camel
          Issue Type: Bug
          Components: camel-aws2
    Affects Versions: 4.18.0, 4.22.0, 4.23.0
            Reporter: Claus Ibsen
             Fix For: 4.24.0


Found while adding the catalog body types of aws2-translate (CAMEL-24961).

h4. 1. A language as option and the other as header sends no language

When the sourceLanguage or the targetLanguage option is set, the producer takes 
both languages from the options and ignores the headers 
({{Translate2Producer}}, main ed3d719b379c, lines 110-125). With 
{{sourceLanguage=it}} and the {{CamelAwsTranslateTargetLanguage}} header, the 
request has no target language, and Camel raises no error. Checked on 
4.24.0-SNAPSHOT with {{camel run}} against a fake of the AWS API that logs the 
requests it gets: the request has {{SourceLanguageCode}} "it" and no 
{{TargetLanguageCode}}.

*Proposed change*: take each language from its option, or else from its header, 
and fail when one is missing.

h4. 2. The code of Croatian is cr

{{Translate2LanguageEnum}} (line 33) has {{CROATIAN("cr")}}. The ISO 639-1 code 
of Croatian, which Amazon Translate uses, is "hr"; "cr" is Cree.

*Proposed change*: {{CROATIAN("hr")}}.

h4. Also read in the code, not run

* The page names an {{amazonTranslateClient}}; the option is 
{{translateClient}}.

_Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to