feat: add styleGuideIds to AI Translation requests#379
Conversation
There was a problem hiding this comment.
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>toApplyPreTranslationRequest(file-based). - Added
styleGuideIds: List<Long>toApplyPreTranslationStringsBasedRequest(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.
|
@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
920b079 to
3e01d1d
Compare
|
Thanks @andrii-bodnar! I moved |
andrii-bodnar
left a comment
There was a problem hiding this comment.
@GabrielBBaldez thank you!
Adds support for the optional
styleGuideIdsfield on the Apply Pre-Translation request (POST /projects/{projectId}/pre-translations), as requested in #372.styleGuideIdsis 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
applyPreTranslationTestandapplyPreTranslationStringsBasedTest(and their request fixtures) to set and sendstyleGuideIds../gradlew testpasses.Closes #372