Configuration

A guide on the gt.config.json file

Overview

The gt.config.json file is used to configure your project's GT settings. It should be placed in the root of your project.

The CLI setup wizard npx gtx-cli init will create a gt.config.json file for you in your project.

Configuration

The three most important properties are:

  • defaultLocale: The default locale for your project. This is the locale that your source content is written in. This is also the fallback locale for your project.

  • locales: An array of locales for your project. These are the locales that you want to translate your project into. See the supported locales for more information. If you are using gt-next or gt-react, these are also the locales that your app supports.

  • files: While optional for react component translation, this field contains information about the files you want to translate. See the files section for more information.

Examples

Here is an example of a gt.config.json file:

gt.config.json
{
  "defaultLocale": "en",
  "locales": ["fr", "es"],
  "files": {
    "json": {
      "include": ["public/locales/[locale].json"]
    }
  }
}

This will translate the public/locales/en.json file to public/locales/fr.json and public/locales/es.json.

en.json
fr.json
es.json
gt.config.json
package.json

Next Steps

How is this guide?

Configuration