Skip to content

feat(glossaries,tm): update glossaries and translation memory API to the latest docs - #421

Merged
andrii-bodnar merged 3 commits into
masterfrom
feature/glossaries-tm-api
Oct 27, 2026
Merged

andrii-bodnar merged 3 commits into
masterfrom
feature/glossaries-tm-api

Conversation

@katerina20

@katerina20 katerina20 commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Part of updating the SDK to the current Crowdin API docs. This PR covers the Glossaries and Translation Memory APIs.

Glossaries

  • Concordance search: SearchConcordanceRequest gets expressions, which the API now requires. expression is deprecated.
  • Terms and concepts:
    • Status.DRAFT added.
    • Enterprise custom fields added to Term, AddTermRequest and Concept.
  • Glossaries: isShared added to Glossary and AddGlossaryRequest.
  • Update concept:
    • New method updateConceptWithRequest(glossaryId, conceptId, UpdateConceptRequest) sends only the fields the PUT endpoint accepts. It has a separate name, not an overload, so existing calls stay unambiguous.
    • The original updateConcept(glossaryId, conceptId, Concept), which sends the Concept response model, is deprecated. Its signature and behaviour are unchanged.
  • Export:
    • The filters are now sent with the documented values: upper-case (NOT_RECOMMENDED, FULL_FORM, …), and UD tags for parts of speech (NOUN, ADJ, X, …).
    • New fields carry them: termStatuses, termTypes, termGenders, termPartsOfSpeech.
    • New filters: text, caseSensitive, searchStrict, searchFullMatch, dateFrom, dateTo.
  • Export status: added the missing attributes (text, caseSensitive, searchFullMatch, searchStrict, status, partOfSpeech, type, gender, authorId, dateFrom, dateTo).
  • listGlossaries: new filter query parameter.
  • Deprecated: ListTermsParams.translationOfTermId, which the API deprecates.

Translation Memory

  • Concordance search: expressions added, expression deprecated.
  • Translation memories: languageId, isShared and webUrl added to TranslationMemory; isShared added to AddTranslationMemoryRequest.
  • New overloads:
    • listTms(ListTmsParams) adds filter and takes a Long userId. The existing method takes Integer, so the change is an overload.
    • listTmSegments(tmId, ListTmSegmentsParams) adds the croql filter.
  • Not added: the TM segment record endpoints (POST/PATCH/DELETE …/segments/{segmentId}/records), because the API deprecates them in favour of Edit TM Segment.

Backward compatibility

No public method, field or class was removed, renamed or retyped.

  • Glossary export filters (behaviour correction):
    • Before, the export request sent term-style values ("preferred", "full form", "noun"), which the export endpoint doesn't document.
    • The deprecated setStatuses/setTypes/setGenders/setPartsOfSpeech now convert term enums to the documented values.
    • Part of speech other maps to X. The published API uses other for glossary terms and X for glossary export, and Universal Dependencies defines X as "other". This hasn't been confirmed by a live Crowdin API test. A dedicated unit test (exportGlossaryRequestDeprecatedSetterMapsOtherPartOfSpeechToXTest) checks that PartOfSpeech.OTHER is sent as "X" and maps back.
    • The deprecated getters convert back. They can't represent the export-only values SYM and COMMON, so they leave them out.
  • Source compatibility: updateConcept(id, id, null) still compiles, because the new method has a different name. A compatibility test (updateConceptWithNullRequestCompatibilityTest) covers it.
  • equals/hashCode/toString include the new fields.

Testing

  • ./gradlew build: 647 tests, 0 failures, on both JDK 17 and JDK 8.
  • ./gradlew javadoc on JDK 8: no errors.
  • New and updated mock tests and fixtures cover:
    • concordance expressions (both APIs);
    • updateConceptWithRequest with the new request, and updateConcept(id, id, null) compiling and calling the original endpoint;
    • the export request JSON (new fields, and conversion from the deprecated setters);
    • the export status attributes;
    • fields, DRAFT, isShared, webUrl, languageId;
    • listTms(ListTmsParams) and listTmSegments with croql.

🤖 Generated with Claude Code

katerina20 and others added 3 commits October 26, 2026 19:25
…the latest docs

Glossaries:
- concordance search: add the required `expressions`, deprecate `expression`
- add DRAFT term status, Enterprise `fields` on terms and concepts,
  `isShared` on glossaries
- add updateConcept overload with a dedicated UpdateConceptRequest and
  deprecate the overload that sends the Concept response model
- export: send the documented upper-case filter values
  (statuses/types/genders/partsOfSpeech via new term* fields; the
  deprecated setters convert term enums), add text, caseSensitive,
  searchStrict, searchFullMatch, dateFrom and dateTo filters
- add the missing export status attributes and the `filter` query
  param for listGlossaries
- deprecate ListTermsParams.translationOfTermId

Translation memory:
- concordance search: add the required `expressions`, deprecate `expression`
- add languageId, isShared and webUrl to TranslationMemory and isShared
  to AddTranslationMemoryRequest
- add listTms(ListTmsParams) with filter and Long userId, and
  listTmSegments(tmId, ListTmSegmentsParams) with croql

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Add a dedicated test that the deprecated
ExportGlossaryRequest.setPartsOfSpeech sends PartOfSpeech.OTHER as "X"
and maps it back, and document that the mapping follows the published
API values (term `other`, export `X`) and Universal Dependencies
semantics but is not confirmed by a live Crowdin API test.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…tWithRequest

The new updateConcept(Long, Long, UpdateConceptRequest) overload made
existing calls such as updateConcept(id, id, null) ambiguous at compile
time. It is now named updateConceptWithRequest; the original
updateConcept(Long, Long, Concept) keeps its signature, deprecation and
runtime behaviour.

Add a compatibility test that calls updateConcept(id, id, null).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@andrii-bodnar
andrii-bodnar merged commit c808e9e into master Oct 27, 2026
3 checks passed
@andrii-bodnar
andrii-bodnar deleted the feature/glossaries-tm-api branch October 27, 2026 08:40
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.

2 participants