跳到正文
DEV Community· 王俊俊·· 4 小時前AI 評分44

如何翻譯 SRT 字幕檔作語言學習,同時保留時間戳

Translating SRT Subtitle Files for Language Study Without Breaking the Timestamps

AI 導讀

翻譯 SRT 字幕檔作語言學習時,應只翻譯文字,保留原有時間戳及字幕區塊對應,避免字幕失去同步。LangScribe 可匯入 SRT、VTT 或 ASS,保留每條字幕的原始時間戳,並在原文下方加入英文譯文;另提供免費翻譯及參照前後字幕語境的 AI 翻譯。

正文

王俊俊

If you study a language with films or series, you probably end up with a pile of .srt files: subtitles from a release, a course download, or a file you exported after fixing a few lines yourself. They look like plain text, so the obvious move is to paste them into a translator. That usually goes wrong in small, annoying ways. Here is what an SRT file actually contains, why naive translation breaks it, and a workflow that keeps the file usable for study.

What is inside an SRT file

Each subtitle block (a "cue") has three parts:

42
00:03:15,200 --> 00:03:18,050
I didn't think you'd actually come.

A sequence number, a start and end time, and one or two lines of text. Players match the text to the picture using only those timestamps. Change them, and the line appears too early, too late, or not at all.

Why pasting into a translator breaks it

  • Timestamps get "translated." Some tools reformat 00:03:15,200 into something else, or swap the comma for a period, and the player rejects the file.
  • Lines merge or split. Translators like full sentences, so a sentence spread over two cues often comes back as one block, and the cue count no longer matches.
  • Context is lost. Translating cue by cue makes short lines ("Again?", "Fine.") ambiguous. Translating the whole file at once makes it hard to map each sentence back to its cue.
  • The original disappears. For a learner this is the biggest loss. You wanted the English next to the original, not instead of it.

A study-friendly workflow

  1. Keep the original file untouched. Treat it as the source of truth for timing.
  2. Translate text only, cue by cue, with a little surrounding context. The translation of cue 42 should know what cues 41 and 43 say, but the result must still land on cue 42.
  3. Show both languages on the same cue. Original on top, translation below. You read the real line first and glance down only when you need to.
  4. Hide one side to test yourself. Watch a scene with only the original, then check the translation afterwards. Or hide the original and try to recall it from the English.
  5. Loop the hard lines. When a line is fast, loop just that cue a few times and shadow it.

Doing it in practice

You can do steps 1–2 with a script (parse the cues, send the text with neighbouring lines as context, write the results back to the same indices), but most learners just want the result. I use LangScribe to translate an SRT file to English: you import the SRT (or VTT/ASS), each cue keeps its original timestamp, and an English line is placed under it. There is a free translation option for everyday use and an AI translation that follows the surrounding cues for better wording. Importing the file itself is free.

Once the file is in, the study part is the same as with any video: bilingual subtitles on screen, previous/next line with one key, A–B repeat on a single cue, and click a word to look it up and save it as a vocabulary card with its original sentence. If you have no subtitle file at all, the same tool can run speech to text on the audio first and give you a timed transcript to work from.

A few tips

  • Check the language of the file first. Some "English" SRTs are machine translations themselves. Translating a translation compounds the errors.
  • Don't fix timing and translation in the same pass. If the file is out of sync, shift it first, then translate.
  • Keep an exported copy. Export the bilingual or translated version as a new SRT so the original stays clean.

An SRT file is already a study text with perfect timing. The trick is to add a translation without destroying the very thing that makes it useful.

來源:DEV Community · dev.to