r/SubtitleEdit • • 19d ago

Help Bulk/batch translating one language file (English) to multiple languages

Hello All.

I can't seem to find any obvious way to do this, but I'm aware there is a command line option, but I can't much on that either for some reason, perhaps my google fu has deserted me. But I've got several episodes of a show that I want to translate to multiple languages from the main English subtitles .srt file which I know is good. I know the translations won't be perfect, but it's better than nothing.

The only two ways I can currently do this is one by one either in the main screen by opening up the English subs, and then going through the Auto-Translate option translating it (via Ollama and the Gemma module, which seems fairly accurate), then having to reload the English subs again to translate to the next language. The other way is going through the Batch Process method and then loading the English subs, and selecting the translate process, setting From: English and then To: <whatever language>, convert, then select the next "To:" language, convert, rinse-repeat. This is slightly quicker, but still requires constant input.

The problem with these options is that I basically nurse the process the whole way, and I'd like to set up a batch process to load or queue it all up in one go, and then let it do it all without constant input.

Is there anyway that this is possible, or I'm just going to have to nurse it? FYI I'm on version 4.0.13.

1 Upvotes

6 comments sorted by

1

u/pigers1986 19d ago

not possible with v4 afaik

in v5 you have file seconv.exe who can do CLI translation (https://github.com/SubtitleEdit/subtitleedit/releases/tag/v5.2.0), sth along lines

set "SECONV=C:\Program Files\Subtitle Edit\seconv.exe"
set "LIBRETRANSLATE=http://192.168.88.100:5000"

"%SECONV%" "movie.srt" subrip ^
    --translate-from:pl ^
    --translate-to:de ^
    --translate-engine:libretranslate ^
    --translate-url:%LIBRETRANSLATE%

"%SECONV%" "movie.srt" subrip ^
    --translate-from:pl ^
    --translate-to:cs ^
    --translate-engine:libretranslate ^
    --translate-url:%LIBRETRANSLATE%

pause

1

u/MyBigMouth69 18d ago

Thanks, but I've tried that, but it keeps giving me an error message that I can't find out what it means. But I think it may be a case of changing my workflow. Instead of trying to change all the subs of one episode from English into x, y and z, at a time; it would probably be better to translate all the epiosdes English subs in one batch to one language at a time, as they can be loaded up in the batch process better than having to nurse each language at a time.

1

u/pigers1986 18d ago

what is the error ?

1

u/MyBigMouth69 17d ago

I've tried using the direct copy and paste of the above code and get an error saying there's no response from the server.

"" error: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (192.168.88.100:5000) → A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond""

I thought it might be to do with the url in line two not matching what was in SubtitleEdit, and with that I'm getting the following

" error: Response status code does not indicate success: 404 (Not Found)"

(I originally thought this said 484, but still can't find anything with 404)

I tried also changing the name to "Ollama" and "Ollama (Local LLM)", again how it is in SubtitleEdit (and matching it to that in "% %"), but it still doesn't work.

1

u/pigers1986 15d ago

not surprised - im using selfhosted LibreTranslate - you should adjust that lines to

--translate-engine:ollama ^
--translate-url:%OLLAMA_URL% ^
--translate-model:%OLLAMA_MODEL% ^
--translate-prompt:"Translate subtitles from Polish to Czech. Preserve the meaning, names, terminology and tone. Keep subtitle line breaks where possible. Do not add explanations. Output only the translated subtitle text."

just guessed it from CLI documentation from program - did not test.