Automatic Translation
How to automatically translate your project using the General Translation CLI tool
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, and MDX 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
Command | Description |
---|---|
npx gtx-cli init | (Optional) Configures your project's GT settings. |
npx gtx-cli setup | Step by step setup guide that prepares your project for translation. |
npx gtx-cli scan | Scans your project for translatable content. Can be used repeatedly to update your project. |
npx gtx-cli translate | Translates your project via the GT API. |
npx gtx-cli generate | Generates a new translation data JSON file. Should be used when using the library standalone. |