Skip to content

Conversation

@jonbulz
Copy link
Contributor

@jonbulz jonbulz commented Nov 27, 2025

Short description

Add option for async machine translations (only for Deepl thus far)

Proposed changes

  • Add translate_asyn boolean flag to translate_queryset in MachineTranslationApiClient
  • Move translation request to Celery task if translate_async=True

Side effects

  • None

Faithfulness to issue description and design

There are no intended deviations from the issue and design.

How to test

Resolved issues

Fixes: #3852


Pull Request Review Guidelines

@jonbulz
Copy link
Contributor Author

jonbulz commented Dec 1, 2025

@PeterNerlich @hannaseithe I have played around a bit to find a way to move deepl api calls to celery, and this is the work in progress. But I'm not really happy with it currently. The main problem is that everything that is passed to celery needs to be JSON-serializable, while our ApiClient is designed to have a lot of rich objects as attributes.
I'll probably suspend this for a bit to work on my issues that are actually in the roadmap. But if you're bored, maybe you could have a look and tell me if you come up with a better idea?

@PeterNerlich
Copy link
Contributor

The main problem is that everything that is passed to celery needs to be JSON-serializable, while our ApiClient is designed to have a lot of rich objects as attributes

For linkcheck I recently tried to work on a wrapper to point to an arbitrary object by specifying the django app defining the model, the model name, and the id. Wouldn't this suffice here as well?

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.

Bulk Action translation fails / times out with large amount of pages/words

3 participants