# General Translation Knowledge Base: How do I keep translations up to date on every deploy?
URL: https://generaltranslation.com/en-GB/kb/translations-in-ci.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: Run translation as a pipeline step before each production build, so new copy ships translated with the deploy that adds it. General Translation's gt CLI does this with npx gt translate, using a project API key and project ID stored as CI secrets.
Category: Workflow Tools
Last updated: 2026-10-21
Authors: Kevin Liu, Kevin Wu
Published: 2026-10-21

Keeping translations up to date on every deploy is called continuous localisation: translation runs as a pipeline step before each release is built, so every change ships in every language with the deploy that adds it. It&#39;s difficult because the step runs in CI (continuous integration): it needs a credential that works without anyone signing in, it should translate only what has changed so that builds stay short, and it has to finish before the build command, otherwise new copy ships untranslated.

## Video

The video is narrated in English, with English captions.

[How do I keep translations up to date on every deploy?](https://caxecubb9c64cezv.public.blob.vercel-storage.com/films/kb-translations-in-ci.mp4) (48 secs)

General Translation keeps translations current when your CI runs `npx gt translate` before the build. Create an API key for CI with the file read, file write, context write and translation queue permissions, store it and your project ID as `GT_API_KEY` and `GT_PROJECT_ID` in your CI provider's secrets, put `npx gt translate` before the build command in your build script, and run that build on every push to main. Each build then translates new and changed text and ships current translations.

## Ways to keep translations current

| Approach                                                                                                                                                                | What it does well                                                                                                                                                                                                                 | When translation happens                                              | What it leaves to you                                                                                                                                                                                                                                             |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| An internationalisation (i18n) library alone (`i18next`, `react-intl`, `next-intl`)                                                                                     | Mature runtimes for rendering translations and formatting values                                                                                                                                                                  | Whenever someone updates the files, often in a batch between releases | Extracting new strings into key files, adding each translation to one file per language, and getting every file translated before the release                                                                                                                     |
| A [translation management system](/kb/general-translation-vs-tms) sync ([Crowdin](/kb/general-translation-vs-crowdin), [Lokalise](/kb/general-translation-vs-lokalise)) | A CLI or GitHub integration uploads new source strings and downloads finished translations                                                                                                                                        | When translators finish, often after the deploy that added the copy   | Key files for every string, the sync configuration, and either holding the release or shipping untranslated copy until translations land                                                                                                                          |
| A custom script on a machine translation or AI API (DeepL, OpenAI API, Claude API)                                                                                      | Translates inside the pipeline, at whatever volume you send                                                                                                                                                                       | In a CI step you write and maintain                                   | Finding new and changed strings, context and consistent terms for each request, writing the results back, and review                                                                                                                                              |
| General Translation (the `gt` CLI)                                                                                                                                      | [`npx gt translate`](/docs/cli/reference/commands/translate) scans [`<T>`](/docs/react/reference/components/t) components, `useGT` calls, and the files in `gt.config.json`, and translates only content whose source has changed | In CI, before the build command                                       | Wrapping new UI copy in [`<T>`](/docs/react/reference/components/t) or passing it to the `gt` function from `useGT`, storing a project API key and the project ID as CI secrets, and reviewing translations in the Dashboard when you want a person to check them |

Use an i18n library alone when translators own the language files and each release can wait for them, and a translation management system sync when translators must approve every string before it ships. Use a custom script for a one-off pass over copy that won&#39;t change. Use a translate step in CI when most releases change copy. If copy changes only occasionally, a simpler set-up will do: run [`npx gt translate`](/docs/cli/reference/commands/translate) locally after [`gt login`](/docs/cli/reference/commands/login), with `projectId` set in `gt.config.json`, and commit the files it writes.

## Add a translate step to CI

General Translation&#39;s `gt` CLI runs this step with [`npx gt translate`](/docs/cli/reference/commands/translate). Because [`gt login`](/docs/cli/reference/commands/login) requires a person to approve it, CI uses a project key instead:

1. Create a key under **Project &gt; API Keys** with **Custom** permissions: set **Files** to **Write**, **Translation queue** to **Enabled**, and **Context** to **Write** if the pipeline generates context.
2. Store the key as `GT_API_KEY` and the project ID as `GT_PROJECT_ID` in your CI provider&#39;s secret settings.
3. Translate before the build:

   ```json title="package.json"
   {
     "scripts": {
       "translate": "npx gt translate",
       "build": "npm run translate && <your build command>"
     }
   }
   ```

## What each run does

With General Translation, each run translates only content whose source has changed, applies the Context Groups (Glossary and Custom Prompts) assigned to the project so that terms stay consistent across releases, and saves the results to your codebase for the build to ship (or publishes them to General Translation&#39;s CDN with `--publish`, for the app to load at run time). The [Generating translations](/docs/cli/guides/generating-translations) guide covers the full steps.

## Related questions

- [How do I internationalise an app with Cursor or Claude Code?](https://generaltranslation.com/en-GB/kb/ai-agent-i18n-setup.mdx): Start with General Translation's Setup for Agents prompt in Cursor or Claude Code, choose a feature and target languages, and have the agent implement and verify the result. Browser sign-in, machine-readable docs and MCP tools connect set-up to translation and review. Use Locadex to automate ongoing localisation through pull requests.
- [How do I review and edit translations?](https://generaltranslation.com/en-GB/kb/review-translations.mdx): Compare each translation with its source and the other locales, and fix anything that doesn't read right. With General Translation, you edit translations on the Dashboard's Translations page and track review with labels and comments, and the next translation run by Locadex, its AI agent, brings the edits into a pull request.
- [What does the Locadex agent do?](https://generaltranslation.com/en-GB/kb/what-is-locadex.mdx): Locadex is General Translation's AI agent which internationalises your code and translates your content in your GitHub repository. Its automations run when a pull request is opened, when a commit is pushed, or when you start one, and every change arrives as a pull request.
- [Can I do i18n without translation files?](https://generaltranslation.com/en-GB/kb/i18n-without-translation-files.mdx): Yes. General Translation's gt-react and gt-next libraries do React and Next.js i18n with no translation keys and no JSON file per language to maintain. Copy stays inline in JSX inside the `<T>` component, and the gt translate command generates each language's translations in your build, with context from your code. Locadex can keep them up to date through pull requests.

## Previous and next questions

- Previous question: [How do I internationalise an app with Cursor or Claude Code?](https://generaltranslation.com/en-GB/kb/ai-agent-i18n-setup.mdx)
- Next question: [How do I review and edit translations?](https://generaltranslation.com/en-GB/kb/review-translations.mdx)

## Sitemap

See the [Knowledge Base sitemap](https://generaltranslation.com/en-GB/kb/sitemap.md) for every article.
