adding latest documentation and changes to the script.

This commit is contained in:
2026-01-12 11:47:39 -05:00
parent 7ad3715c52
commit 2a7878ddad
10 changed files with 144 additions and 10 deletions
@@ -7,6 +7,7 @@ import pysubs2
from deep_translator import GoogleTranslator, MyMemoryTranslator
import ollama
from tqdm import tqdm
from utils import LANGUAGE_MAP
# Define a retry decorator
# ... (retry_policy remains)
@@ -243,13 +244,8 @@ def translate_with_auto_fallback(srt_content, target_language="English", prefer_
tuple: (translated_content, method_name) or (None, None) if all failed.
"""
# Map full language name to code for DeepTranslate
lang_map = {
"English": "en", "French": "fr", "Spanish": "es", "German": "de",
"Italian": "it", "Portuguese": "pt", "Russian": "ru",
"Japanese": "ja", "Chinese": "zh-CN"
}
target_code = lang_map.get(target_language, "en")
# Use central language mapping
target_code = LANGUAGE_MAP.get(target_language, "en")
# Determine which services to even try
def is_ok(name):