Skip to content

feat: add pre_translation_batch_operations method#249

Merged
andrii-bodnar merged 2 commits intomainfrom
copilot/add-pre-translation-batch-operations
Mar 13, 2026
Merged

feat: add pre_translation_batch_operations method#249
andrii-bodnar merged 2 commits intomainfrom
copilot/add-pre-translation-batch-operations

Conversation

Copy link
Contributor

Copilot AI commented Mar 13, 2026

Exposes the PATCH /projects/{projectId}/pre-translations endpoint, which applies a JSON Patch document (RFC 6902) to update multiple pre-translations in a single request (e.g. bulk status/priority changes).

This is distinct from the existing edit_pre_translation, which targets a single resource at …/pre-translations/{preTranslationId}.

Changes

  • translations/resource.py — added pre_translation_batch_operations(data, projectId) method
  • tests/test_translations_resources.py — added corresponding unit test

Usage

translations.pre_translation_batch_operations(
    projectId=1,
    data=[
        {
            "op": PreTranslationEditOperation.REPLACE,
            "path": "/9e7de270-4f83-41cb-b606-2f90631f26e2/status",
            "value": "canceled",
        },
        {
            "op": PreTranslationEditOperation.REPLACE,
            "path": "/9e7de270-4f83-41cb-b606-2f90631f26e2/priority",
            "value": "high",
        },
    ],
)

Reuses the existing EditPreTranslationScheme type — no new types or enums required.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add support for Pre-Translation Batch Operations</issue_title>
<issue_description>The Crowdin API adds a Pre-Translation Batch Operations method: PATCH /projects/{projectId}/pre-translations. It accepts a JSON Patch document (RFC 6902) to update multiple pre-translations in one request (e.g. change status or priority). API client libraries should expose this endpoint so consumers can perform batch updates on pre-translations via the SDK.

References:

Comments on the Issue (you are @copilot in this section)


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Co-authored-by: andrii-bodnar <29282228+andrii-bodnar@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for Pre-Translation Batch Operations feat: add pre_translation_batch_operations method Mar 13, 2026
Copilot AI requested a review from andrii-bodnar March 13, 2026 15:33
@andrii-bodnar andrii-bodnar marked this pull request as ready for review March 13, 2026 15:36
@codecov-commenter
Copy link

codecov-commenter commented Mar 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.40%. Comparing base (e698cd5) to head (5caaf29).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #249      +/-   ##
==========================================
+ Coverage   99.40%   99.40%   +0.01%     
==========================================
  Files         182      182              
  Lines        8596     8606      +10     
  Branches      191      191              
==========================================
+ Hits         8544     8554      +10     
  Misses         36       36              
  Partials       16       16              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@andrii-bodnar andrii-bodnar merged commit 40dda5b into main Mar 13, 2026
8 checks passed
@andrii-bodnar andrii-bodnar deleted the copilot/add-pre-translation-batch-operations branch March 13, 2026 15:38
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 Pre-Translation Batch Operations

3 participants