Align built-in pretranslation with the pretranslation upload API
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 611
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 49
Description
POST /api/v2/upload/pretranslations/ (#4511) makes different choices from the built-in pretranslation (pontoon/pretranslation/tasks.py). We agreed to bring the two in line rather than let them drift.
Strings with unreviewed suggestions
The built-in pretranslation skips any entity with a non-rejected translation. The API pretranslates it: a matching suggestion becomes the active pretranslation, keeping its author; other suggestions stay unreviewed.
Fuzzy translations already in Pontoon.
Skipped by the same filter above; the API rejects and replaces them.
Failing checks
Both run run_checks(use_tt_checks=False), so TT checks are already disabled in both and should stay disabled. But the built-in retries once with preserve_placeables=True and stores the result unchecked (tasks.py:126-135), then flags it via bulk_run_checks() and skips it during sync; the API drops it, stores nothing, and reports it in failed_checks. → Decide whether a failing pretranslation is stored and flagged, or refused.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Compare the built-in pretranslation in pontoon/pretranslation/tasks.py, especially tasks.py:126-135, with POST /api/v2/upload/pretranslations/ and the discussion in pull request #4511. First resolve how failing pretranslations should be handled; done means both paths make the same choices for unreviewed suggestions, fuzzy translations, and failing checks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- localization
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100