pc translate sentences
This commit is contained in:
@@ -144,6 +144,11 @@ class SubtitleTranslationService:
|
||||
payload["terms"] = terms
|
||||
return AdminSubtitleTranslationResponse(**payload)
|
||||
|
||||
def ensure_from_local(self, document: SentenceBoundaryDocument) -> SubtitleTranslationResponse:
|
||||
"""Accept locally generated English subtitles, then translate like a course."""
|
||||
self.repository.import_local_subtitle_document(document)
|
||||
return self.ensure(document.video_hash)
|
||||
|
||||
def ensure(self, video_hash: str) -> SubtitleTranslationResponse:
|
||||
if not getattr(self.ai_tutor, "available", False):
|
||||
raise AITutorError("AI translation is not configured.")
|
||||
|
||||
Reference in New Issue
Block a user