Skip to content

feat: add styleGuideIds to AI Translation requests#379

Merged
andrii-bodnar merged 1 commit into
crowdin:masterfrom
GabrielBBaldez:feat/pretranslation-style-guide-ids
Jun 9, 2026
Merged

feat: add styleGuideIds to AI Translation requests#379
andrii-bodnar merged 1 commit into
crowdin:masterfrom
GabrielBBaldez:feat/pretranslation-style-guide-ids

Conversation

@GabrielBBaldez

Copy link
Copy Markdown
Contributor

Adds support for the optional styleGuideIds field on the Apply Pre-Translation request (POST /projects/{projectId}/pre-translations), as requested in #372.

styleGuideIds is an array of Style Guide identifiers used during pre-translation. It is added to both request variants to keep them consistent:

  • ApplyPreTranslationRequest (file-based)
  • ApplyPreTranslationStringsBasedRequest (strings-based)

Tests

  • Updated applyPreTranslationTest and applyPreTranslationStringsBasedTest (and their request fixtures) to set and send styleGuideIds.
  • ./gradlew test passes.

Closes #372

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for the optional styleGuideIds field to the Apply Pre-Translation request models so SDK consumers can pass Style Guide identifiers when calling POST /projects/{projectId}/pre-translations (per issue #372).

Changes:

  • Added styleGuideIds: List<Long> to ApplyPreTranslationRequest (file-based).
  • Added styleGuideIds: List<Long> to ApplyPreTranslationStringsBasedRequest (strings-based).
  • Updated translation API tests and request JSON fixtures to include and send styleGuideIds.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/main/java/com/crowdin/client/translations/model/ApplyPreTranslationRequest.java Adds styleGuideIds to the file-based pre-translation request model for JSON serialization.
src/main/java/com/crowdin/client/translations/model/ApplyPreTranslationStringsBasedRequest.java Adds styleGuideIds to the strings-based pre-translation request model for JSON serialization.
src/test/java/com/crowdin/client/translations/TranslationsApiTest.java Extends apply pre-translation tests to set styleGuideIds and validate request mocking.
src/test/resources/api/translations/preTranslationRequest.json Updates the mocked request payload to include styleGuideIds.
src/test/resources/api/translations/preTranslationStringsBasedRequest.json Updates the mocked request payload to include styleGuideIds.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@andrii-bodnar

Copy link
Copy Markdown
Member

@GabrielBBaldez, thanks for your contribution! There was an error in the original issue that pointed to the incorrect API endpoint. I updated the description. Could you please address this in the current PR?

Expose the optional styleGuideIds field on AiTranslateRequest (AI Translate Strings) and AiFileTranslationAddRequest (AI File Translation) — an array of Style Guide identifiers used as context during AI translation.

Closes crowdin#372
@GabrielBBaldez GabrielBBaldez force-pushed the feat/pretranslation-style-guide-ids branch from 920b079 to 3e01d1d Compare June 9, 2026 11:38
@GabrielBBaldez GabrielBBaldez changed the title feat: add styleGuideIds to Apply Pre-Translation request feat: add styleGuideIds to AI Translation requests Jun 9, 2026
@GabrielBBaldez

Copy link
Copy Markdown
Contributor Author

Thanks @andrii-bodnar! I moved styleGuideIds to the AI Translation requests (AiTranslateRequest and AiFileTranslationAddRequest) per the updated issue description, and reverted the Pre-Translation changes. Tests and fixtures updated accordingly.

@andrii-bodnar andrii-bodnar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@GabrielBBaldez thank you!

@andrii-bodnar andrii-bodnar merged commit 1fad049 into crowdin:master Jun 9, 2026
3 checks passed
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.

Add support for styleGuideIds in AI Translation methods

3 participants