[CHA-5060] feat: support multiple auto-translation languages - #268
Merged
Conversation
The backend accepts up to five comma-separated values in auto_translation_language, but ChannelRequestObject only exposed a single Language enum, so calling the builder setter per language kept only the last one. Add autoTranslationLanguages(List<Language>), deprecate the single language setter, and serialize either into the comma-separated list.
mogita
commented
Sep 2, 2026
mogita
left a comment
Contributor
Author
There was a problem hiding this comment.
Reviewed at 2af25f7. Two inline comments, no blockers.
Collectors.joining returned an empty string for an empty list, or for a list holding only nulls, putting auto_translation_language="" on the wire. Return null instead, and drop Language.UNKNOWN, which the deserializer hands back for any code this SDK does not know.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket
CHA-5060
Problem
auto_translation_languageaccepts up to five comma-separated languages, butChannelRequestObjecttyped it as a singleLanguageenum. eBay called the builder setter once per language and each call overwrote the previous one, so only the last language was sent.Solution
ChannelRequestObjectgetsautoTranslationLanguages(List<Language>), serialized as the comma-separated list the backend expects. The single-language setter still works and is now deprecated; the list wins when both are set.Language.getValue()returns the wire value so regional codes such ases-MXkeep their casing. Docs note that the field only applies to channel create or full update, since partial update rejects it as reserved.How to verify
./gradlew test --tests '*ChannelAutoTranslationLanguageTest*'passes (4 tests, no API credentials needed)..autoTranslationLanguages(List.of(Language.IT, Language.FR, Language.ES_MX))and confirm the request body carries"auto_translation_language":"it,fr,es-MX"..autoTranslationLanguage(Language.IT)setter and confirm it still serializes"auto_translation_language":"it".