Automatic Translation

Automatically translate your project files with General Translation.

Overview

General Translation provides powerful tools to translate entire files in your project directly through the CLI. This allows you to translate:

  • JSON Files: Translate your i18n JSON files for any library including next-intl, i18next, or custom JSON formats
  • Markdown/MDX Files: Translate your documentation or content files while preserving all formatting and structure
  • TypeScript/JavaScript Files: Translate strings in your code files without affecting their functionality

With the GT CLI tool, you can translate entire directories of files with a single command, making it easy to localize your entire project.

Supported File Types

General Translation supports the following file types:

File TypeDescription
jsonJSON files used by i18n libraries like next-intl, i18next, etc.
mdxMarkdown component files used for documentation
mdStandard markdown files
jsJavaScript files
tsTypeScript files
gtGT-specific translation files used by gt-next and gt-react

How It Works

  1. Install the GT CLI tool: npm install --save-dev gtx-cli
  2. Configure your project with the gt.config.json file
  3. Run npx gtx-cli translate to automatically translate all specified files

That's it! No need to wait days for translations, just run a command and get your translations in minutes.

Benefits

  • Maintain Context: Files are translated as a whole, preserving context and improving translation quality
  • Preserve Structure: All formatting, code structure, and syntax are preserved in translated files
  • Automation: Integrate with CI/CD pipelines to automate translation in your workflow
  • Multi-format Support: Translate different file types with a single configuration
  • i18n Library Compatibility: Works with any i18n library or custom format

How is this guide?