How to Translate SRT Files Without Breaking Timestamps
A structure-safe SRT translation method that protects cue numbers, timestamps, tags, and synchronization while allowing natural target text.
An SRT file mixes translatable dialogue with machine-readable structure. The safe goal is not “never touch a timestamp”; it is “do not let the translation process accidentally rewrite timing.” Deliberate resegmentation can happen later with validation.
Separate protected and translatable content
103
00:08:14,250 --> 00:08:17,900
Back up the source before you replace the file.
Protect 103 and the entire timing line. Translate only the text. A spreadsheet handoff can use columns for cue ID, start, end, source, target, and notes. A subtitle editor can lock time fields while displaying video context.
Round-trip procedure
- Validate the source SRT and save its checksum or untouched copy.
- Parse cues into structured records; do not split the file with an unreliable blank-line expression alone.
- Export cue ID, start, end, source text, and target text fields.
- Translate with neighboring cues visible.
- Rebuild SRT from the protected timing fields and target text.
- Compare cue count and every timestamp against the source.
- Run encoding, overlap, and playback checks.
A simple integrity report should say whether cue count changed, which timestamp lines differ, and which targets are empty. It should not merely report that the file saved successfully.
Do not use broad replacement on the full file
Machine translation pasted over the entire document may change arrows, punctuation, digits, or blank lines:
00:08:14,250 --> 00:08:17,900
must keep two hyphens and a greater-than sign. A typographic arrow (→) is invalid SRT timing syntax. Localized digits may also confuse importers. Protect structure programmatically.
Natural text can cross cue boundaries
Source cues sometimes split a sentence badly:
11
00:00:40,000 --> 00:00:42,000
If the export fails,
12
00:00:42,050 --> 00:00:44,500
check the first malformed cue.
Translate the complete sentence, then divide the target at a natural point while retaining the two time windows. If the target cannot fit, flag it for deliberate timing adjustment rather than overflowing the cue silently.
Tags, placeholders, and URLs
Preserve supported tags such as <i>, variables such as {count}, and URLs. Verify balanced tags after rebuilding. Translators should receive a note explaining which tokens may move and which must remain exact.
Automated checks after translation
- Same number of cues unless resegmentation was approved.
- Same start/end values in a timestamp-locked workflow.
- No empty target cue.
- No source-language leftovers except approved names and tokens.
- Valid UTF-8 and expected line endings.
- No new overlaps or negative durations.
- Reading-speed warnings reviewed, not blindly truncated.
Use SRT vs VTT before changing formats, and the subtitle quality checklist before delivery. If the file feeds speech, follow TTS and dubbing preparation; subtitle-friendly compression may sound abrupt when spoken.
This protected-structure approach fits the translation stage in the complete YouTube subtitle workflow and provides a reproducible audit trail for every intentional timing change.