# gt: General Translation CLI tool: GT
URL: https://generaltranslation.com/en-US/docs/cli/reference/formats/gt-jsx-files.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: Translate gt-next, gt-react, and gt-react-native projects with General Translation. API reference for the gt file format.

The `gt` file format holds the translations for projects that use [`gt-react`, `gt-next`, or `gt-react-native`](/docs/react/overview). When you run [`gt translate`](/docs/cli/reference/commands/translate), the CLI scans your source code for inline content — such as [`<T>`](/docs/react/reference/components/t) components and [`useGT`](/docs/react/reference/hooks/use-gt) calls — plus your dictionary, and writes the results in this format.

## Configuration [#config]

Add a `gt` entry under `files`. It accepts an `output` path with a `[locale]` placeholder for saving translations locally.

```json title="gt.config.json"
{
  "defaultLocale": "en",
  "locales": ["fr", "es"],
  "files": {
    "gt": {
      "output": "public/i18n/[locale].json"
    }
  }
}
```

This saves French and Spanish translations to `public/i18n/fr.json` and `public/i18n/es.json`, which you can load with [`loadTranslations`](/docs/react/reference/functions/load-translations).

## Storage options [#storage]

- **Local:** set `output` to bundle translations in your app. This is the default — the CLI does not publish to the CDN with this configuration.
- **CDN:** omit `output` and enable publishing to load translations at runtime instead. See [CDN publishing](/docs/cli/reference/config#cdn-publishing).

Currently, only one output file per locale can be generated.

## Inline content parsing [#parsing]

The `gt` entry accepts a `parsingFlags` object that controls how the CLI parses inline content. All flags are disabled or off by default.

```json title="gt.config.json"
{
  "files": {
    "gt": {
      "parsingFlags": {
        "autoderive": true,
        "devHotReload": true,
        "enableAutoJsxInjection": true,
        "includeSourceCodeContext": true,
        "legacyGtReactImportSource": false
      }
    }
  }
}
```

- `autoderive` — parses interpolated values in [`t()`](/docs/react/reference/functions/t-function), `gt()`, and [`msg()`](/docs/react/reference/functions/msg) calls and expressions inside [`<T>`](/docs/react/reference/components/t) components as if wrapped in [`derive()`](/docs/react/reference/functions/derive), generating a separate translation entry per possible value. Accepts `true` or an object such as `{ "jsx": true, "strings": false }`. See [Auto-derive translations](/docs/cli/guides/using-autoderive).
- `devHotReload` — enables runtime translation for new content during development. `true` enables string translation; use an object such as `{ "strings": true, "jsx": true }` to control string and JSX handling separately.
- `enableAutoJsxInjection` — wraps translatable JSX text in [`<T>`](/docs/react/reference/components/t) components at build time so you do not have to add them by hand. See [Automatic JSX injection](/docs/cli/guides/using-auto-jsx).
- `includeSourceCodeContext` — includes the surrounding source code lines as extra context for each translation. Replaces the deprecated top-level `files.gt.includeSourceCodeContext` key.
- `legacyGtReactImportSource` — makes compiler-injected imports resolve to `gt-react/browser`. Enable it only with legacy `gt-react` versions that export this path; current versions use the root `gt-react` import.

## Sitemap

See the full [sitemap](https://generaltranslation.com/sitemap.md) for all pages.
