# How do I keep translations up to date on every deploy?

50.1 s · Narrator: Frederick Surrey

Run npx gt translate in CI before your production build, with a scoped GT_API_KEY and GT_PROJECT_ID from your CI provider's secrets. Each build translates new and changed text and ships current translation files.

| Time | Voice | Line | On screen |
| --- | --- | --- | --- |
| 0:00.88 | Narrator | In Montreal, your French page shows the line you added this week in English. | A browser draws in the middle of the frame, its tab and address drawn as bars. On "Montreal" the language code `fr` appears over its top right corner, and on "French" the page rises: a French heading, the line "Your order is on its way." in English, two bars of copy and a white button with a French label. The heading "This week's line in English" rises on "the", and on "English" the English line turns blue. |
| 0:05.52 | Narrator | Your build script runs next build alone, so the line was never translated. | On "build" the browser slides to the right. On "script" a code panel opens with `package.json`, whose build script reads `"build": "next build"`. On the second "build" the blue moves from the English line to that row. On "so" a line joins the row to the English line on the page, and on "translated" a white box draws around the row. |
| 0:10.30 | Narrator | General Translation keeps translations current when your CI runs npx gt translate before the build. | The answer card cuts in on "General": the answer alone rises as it is spoken, in two lines, "General Translation keeps translations current" then "when your CI runs npx gt translate before the build", and the General Translation mark sits small in the lower left corner. |
| 0:17.54 | Narrator | Create an API key for CI with the file, context and translation queue permissions. | The heading "Create an API key for CI". The code panel opens again on a terminal where `npx gt login` has run. On "Create" `npx gt api-key create` is typed, marked by a blue bar, and its options rise as they are named: `--project-id your-project-id` on "key", `--name "CI build"` on "CI", `--permission project:files:read` and `project:files:write` on "file", `project:context:write` on "context", and `project:translations:enqueue` on "translation". On "permissions" a white box draws around the four permissions, and the key the command prints appears as a row of dots. |
| 0:24.48 | Narrator | Store it and your project ID as secrets in your CI provider. | The heading "Set the CI secrets". A page opens on the right: "Actions secrets and variables", with the "Secrets" tab chosen beside "Variables", "Repository secrets" and a "New repository secret" button. On "it" a line joins the printed key to the page, where `GT_API_KEY` appears on "and" and `GT_PROJECT_ID` on "project". A white box draws around both on "secrets". |
| 0:29.46 | Narrator | Add npx gt translate to your build script, before the build command. | The heading "Add npx gt translate to your build script". The code panel cuts to `package.json` as the cause showed it, and on "npx" `npx gt translate && ` is typed in front of `next build`, marked by a blue bar. On "script" a white box draws around the build script, and on "before" around `next build`. |
| 0:34.36 | Narrator | Run that build on every push to main, for example with a GitHub Actions workflow. | The heading "Build on every push to main". The code panel cuts to `.github/workflows/build.yml`: on a push to main, a job on ubuntu-latest checks out the code, runs `npm ci` and runs `npm run build` with `GT_API_KEY` and `GT_PROJECT_ID` from the repository's secrets. A white box draws around `npm run build` on "build", `push:` and `[main]` turn blue on "push", and on "GitHub" a line joins the `GT_API_KEY` line to the secret on the page. |
| 0:39.86 | Narrator | Each build then ships current translations in Spanish, Japanese and French. | The browser cuts back in the middle of the frame, in English, with the code `en`: "Welcome back", "Your order is on its way.", the copy bars and "Get started". On "current" a white box draws around the order line, and it stays there as the page switches to Spanish on "Spanish", to Japanese on "Japanese" and to French on "French", the code changing with it. At the end of the line the French order line turns blue, in the place where the English one turned blue at the start. |
| 0:44.88 | No voice |  | The end card: the General Translation logo with generaltranslation.com/docs/cli/guides/generating-translations 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.
