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 Type | Description |
---|---|
json | JSON files used by i18n libraries like next-intl, i18next, etc. |
mdx | Markdown component files used for documentation |
md | Standard markdown files |
js | JavaScript files |
ts | TypeScript files |
gt | GT-specific translation files used by gt-next and gt-react |
How It Works
- Install the GT CLI tool:
npm install --save-dev gtx-cli
- Configure your project with the
gt.config.json
file - 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?