# How do I translate SRT subtitles?

53.5 s · Narrator: Frederick Surrey

The CLI translates cue text in SubRip (.srt) subtitle files while preserving cue numbers, timestamps, separators, and markup.

| Time | Voice | Line | On screen |
| --- | --- | --- | --- |
| 0:00.88 | Narrator | In Santiago, a viewer turns on the subtitles of your product video, and every line is English. | A video page draws in the middle of the frame. On "Santiago" the language code `es` appears over its top right corner: the language the viewer's browser asks for. On "viewer" the page fills in: a paused video with its picture drawn in bars, the player's bar at 0:42 of 1:20, and the page's text as bars. On "turns" the subtitle menu appears at the right of the player's bar, reading "English", and on "subtitles" the subtitle line rises over the video: "Click Save to publish the translation." The heading "Every line is English" rises on "every", and on "English" the subtitle line turns blue. |
| 0:07.68 | Narrator | The video has one subtitle file, and every cue in it is English. | On "The" the page slides to the right, and on "video" a code panel opens with `subtitles/en/intro.srt`: cue 12, its timing line `00:00:41,200 --> 00:00:44,900` and its text "Click Save to publish the translation.", then cue 13. On "file" the blue moves from the page to cue 12's text in the file, on "and" a line joins that row to the subtitle line on the page, on "cue" cue 13's text turns blue as well, and on "English" a white box draws around cue 12. |
| 0:13.16 | Narrator | General Translation translates the text in SRT subtitle files and keeps every timestamp. | The answer card cuts in on "General": the answer alone rises as it is spoken, in two lines, "General Translation translates the text" then "in SRT subtitle files and keeps every timestamp", and the General Translation mark sits small in the lower left corner. |
| 0:20.60 | Narrator | Install gt, then list the subtitle files in gt.config.json, with one folder per locale. | The code panel opens again with a terminal, and `npm install gt --save-dev` is typed on "Install", marked by a blue bar; a file panel opens on the right with `package.json` and `subtitles/en/intro.srt`. The heading "List the subtitle files in gt.config.json" rises on "list", and the panel cuts to `gt.config.json`: the default locale `en`, the locales `es` and `fr`, and an `srt` entry that includes `subtitles/[locale]/**/*.srt`. On "files" the path turns blue, `gt.config.json` appears in the file panel as its name is said, on "folder" the blue narrows to `[locale]`, and on "locale" a white box draws around the include line. |
| 0:28.70 | Narrator | Sign in, add your project ID, and run npx gt translate for the Spanish and French files. | The panel cuts to the terminal, and `npx gt login` is typed on "Sign". On "project" `.env.local` opens under it with `GT_PROJECT_ID=your-project-id`, the docs' placeholder. The heading "Run npx gt translate" rises with a new prompt, and `npx gt translate` is typed on "npx". On "Spanish" `es/` and its `intro.srt` appear in the file panel under `subtitles/`, and on "French" `fr/` and its `intro.srt`. |
| 0:35.96 | Narrator | Each new file keeps the timing lines and cue numbers, and only the words change. | The heading "Unchanged timing lines" rises, and the panel cuts to cue 12 of the English file over cue 12 of the Spanish file, `subtitles/es/intro.srt`. On "timing" both timing lines turn blue, on "cue" the blue moves to both cue numbers, on "numbers" a white box draws around the Spanish file's number and timing line, and on "words" the blue moves to the Spanish text. |
| 0:41.30 | Narrator | In Santiago, the player loads the new files, and the same cue reads in French or Spanish. | The video page cuts back in the middle of the frame, as it was, in English. On "player" the subtitle menu opens with the three languages, each in its own name, and it closes on "same". On "French" the subtitle line and the menu change to French, and on "Spanish" to Spanish. Then the Spanish line turns blue, where the English line was. |
| 0:48.34 | No voice |  | The end card: the General Translation logo with generaltranslation.com/docs/cli/reference/formats/srt-files under it, held to the last frame while the music ends on a held chord. |

Times are where each line starts in the final, read from the film's own audio.
