@@ -310,7 +310,7 @@ def transcribe(
310310) -> None :
311311 """
312312 Defer a new job for `ftm-transcribe`
313- It will only deferred if `OPENALEPH_TRANSCRIBE_DEFER=1` (the default)
313+ It will only deferred if `OPENALEPH_TRANSCRIBE_DEFER=1` (the default is not )
314314
315315 Args:
316316 app: The procrastinate app instance
@@ -331,6 +331,32 @@ def transcribe(
331331 job .defer (app , priority )
332332
333333
334+ def translate (
335+ app : App , dataset : str , entities : Iterable [EntityProxy ], ** context : Any
336+ ) -> None :
337+ """
338+ Defer a new job for `ftm-translate`
339+ It will only deferred if `OPENALEPH_TRANSLATE_DEFER=1` (the default is not)
340+
341+ Args:
342+ app: The procrastinate app instance
343+ dataset: The ftm dataset or collection
344+ entities: The file entities to ingest
345+ context: Additional job context
346+ """
347+ if tasks .translate .defer :
348+ job = DatasetJob .from_entities (
349+ dataset = dataset ,
350+ queue = tasks .translate .queue ,
351+ task = tasks .translate .task ,
352+ entities = entities ,
353+ dehydrate = True ,
354+ ** context ,
355+ )
356+ priority = get_priority (context , tasks .translate .get_priority ())
357+ job .defer (app , priority )
358+
359+
334360def geocode (
335361 app : App , dataset : str , entities : Iterable [EntityProxy ], ** context : Any
336362) -> None :
0 commit comments