Skip to content

[CHA-5060] feat: support multiple auto-translation languages - #268

Merged
mogita merged 2 commits into
mainfrom
feat/cha-5060-multi-auto-translation-languages
Sep 2, 2026
Merged

[CHA-5060] feat: support multiple auto-translation languages#268
mogita merged 2 commits into
mainfrom
feat/cha-5060-multi-auto-translation-languages

Conversation

@mogita

@mogita mogita commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Ticket

CHA-5060

Problem

auto_translation_language accepts up to five comma-separated languages, but ChannelRequestObject typed it as a single Language enum. eBay called the builder setter once per language and each call overwrote the previous one, so only the last language was sent.

Solution

ChannelRequestObject gets autoTranslationLanguages(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 as es-MX keep 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

  1. ./gradlew test --tests '*ChannelAutoTranslationLanguageTest*' passes (4 tests, no API credentials needed).
  2. Create or fully update a channel with .autoTranslationLanguages(List.of(Language.IT, Language.FR, Language.ES_MX)) and confirm the request body carries "auto_translation_language":"it,fr,es-MX".
  3. Build a request with the old .autoTranslationLanguage(Language.IT) setter and confirm it still serializes "auto_translation_language":"it".

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 mogita left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at 2af25f7. Two inline comments, no blockers.

Comment thread src/main/java/io/getstream/chat/java/models/Channel.java Outdated
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.
@mogita
mogita merged commit 7a3f117 into main Sep 2, 2026
5 checks passed
@mogita
mogita deleted the feat/cha-5060-multi-auto-translation-languages branch September 2, 2026 10:29
@github-actions github-actions Bot mentioned this pull request Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant