Automatic Translation

How to automatically translate your project using the General Translation CLI tool

npx gtx-cli@latest init

Overview

The General Translation CLI tool (gtx-cli) allows you to automatically translate your project into any of the supported languages.

It provides first-class support for gt-next and gt-react with your project, allowing you to scan your project for translatable content, translate your project, and generate translation data JSON files.

The CLI tool can also be used to generate translations for third-party i18n libraries like next-intl or i18next.

Lastly, the CLI tool can be used to translate JSON, Markdown, MDX, JS, and TS files.

A Production API key is required for the translate command. Get one for free at generaltranslation.com!


Depending on what i18n library your project is using, please follow one of the following tutorials:

Usage

CommandDescription
npx gtx-cli initRun the GT setup wizard.
npx gtx-cli setupStep by step setup guide that helps internationalize your React app.
npx gtx-cli scanScans your project for translatable content. Can be used repeatedly to update your project.
npx gtx-cli translateTranslates your project via the GT API.
npx gtx-cli generateGenerates a new translation data JSON file. Should be used when using the library standalone.
npx gtx-cli authGenerate an API key and project ID for your project.
npx gtx-cli configureConfigure your project's GT settings.

On this page