# gt-next: General Translation Next.js SDK: gt.config.json URL: https://generaltranslation.com/en-GB/docs/next/api/config/gt-config-json.mdx --- title: gt.config.json description: The gt.config.json file --- {/* AUTO-GENERATED: Do not edit directly. Edit the template in content/docs-templates/ instead. */} ## Overview The `gt.config.json` file stores your project's configuration. It contains important information such as your project's `projectId`, your supported locales, and more. It also contains important internal information such as your project's `versionId`. This file is read by (1) your [``](/docs/next/api/components/gtprovider) component and (2) the [`gt translate`](/docs/cli/translate) command. Because of this, we recommend storing your configuration in your `gt.config.json` file instead of passing it as a prop to your [``](/docs/next/api/components/gtprovider) component. Generally, anything that begins with an underscore (e.g. `_versionId`) is an internal property and should not be modified. Everything else is fair game. *** ## Fields | Field | Type | Description | | ------------------- | ---------- | ------------------------------------------------------------------------ | | `projectId` | `string` | Unique identifier for your project in the GT system | | `locales` | `string[]` | Array of supported locale codes for your project | | `defaultLocale` | `string` | The primary locale code used as a fallback when translations are missing | | `cacheUrl` | `string` | URL endpoint for caching translation data | | `runtimeUrl` | `string` | URL endpoint for runtime translation services | | `stageTranslations` | `boolean` | Configuration for staging/preview translation features | | `files` | `object` | Path to local translation files for development and testing | | `_versionId` | `string` | Internal property used to track the project version (do not modify) | ### `cacheUrl` and `runtimeUrl` If you store your translations in the cloud, `cacheUrl` is the base URL for the cache. `runtimeUrl` is the base URL for the runtime and is only used for development translations. ### `stageTranslations` `stageTranslations` is a flag used by the `gt` tool to mark your translations as requiring review. This means they must be manually approved before they can be deployed to production via the [`gt translate`](/docs/cli/translate) command. ### `files` The `files` field specifies a path to locally stored translations (rather than storing them in the cloud). Specifically, the `output` field specifies where the translations will be written. ```json { "files": { "gt": { "output": "public/_gt/[locale].json" } }, } ``` See the CLI tool [configuration docs](/docs/cli/reference/config) for more information on how to use the `files` field. #### `parsingFlags` The `files.gt.parsingFlags` object controls how the compiler parses your source files. | Flag | Type | Default | Description | | ------------------------ | --------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `enableAutoJsxInjection` | `boolean` | `false` | Automatically wrap translatable JSX text in translation components at build time. See [auto JSX injection](/docs/cli/features/auto-jsx-injection). | | `autoderive` | `boolean` | `false` | Automatically treat interpolated values in `t()`, `gt()`, and `msg()` calls as [`derive()`](/docs/next/api/strings/derive) calls. See [autoderive](/docs/cli/features/autoderive). | ```json title="gt.config.json" { "files": { "gt": { "output": "public/_gt/[locale].json", "parsingFlags": { "enableAutoJsxInjection": true, "autoderive": true } } } } ``` {{/* ### `_versionId` Points to hit: - internal - you can specify your own version names */}} *** ## Examples ### Specifying your locales ```json title="gt.config.json" { "defaultLocale": "en", // Primary locale is English "locales": ["fr", "es"] // Secondary locales are French and Spanish } ``` {/* ### Specifying your own versionId */} *** ## Notes * The `gt.config.json` file is used to specify your project's configuration. * It is read by both the [``](/docs/next/api/components/gtprovider) component and the [`gt translate`](/docs/cli/translate) command. * It should be placed in the root of your project. ## Next steps